{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/8599","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/8599/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/8599/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/8599/events","html_url":"https://github.com/dotnet/coreclr/issues/8599","id":195076744,"number":8599,"title":"[RyuJIT] TreeNodeInfoInitCmp incorrectly drops a required cast","user":{"login":"mikedn","id":9973420,"avatar_url":"https://avatars.githubusercontent.com/u/9973420?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedn","html_url":"https://github.com/mikedn","followers_url":"https://api.github.com/users/mikedn/followers","following_url":"https://api.github.com/users/mikedn/following{/other_user}","gists_url":"https://api.github.com/users/mikedn/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedn/subscriptions","organizations_url":"https://api.github.com/users/mikedn/orgs","repos_url":"https://api.github.com/users/mikedn/repos","events_url":"https://api.github.com/users/mikedn/events{/privacy}","received_events_url":"https://api.github.com/users/mikedn/received_events","type":"User","site_admin":false},"labels":[{"id":196940911,"url":"https://api.github.com/repos/dotnet/coreclr/labels/area-CodeGen","name":"area-CodeGen","color":"d4c5f9","default":false},{"id":172143003,"url":"https://api.github.com/repos/dotnet/coreclr/labels/bug","name":"bug","color":"1d76db","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/coreclr/milestones/9","html_url":"https://github.com/dotnet/coreclr/milestone/9","labels_url":"https://api.github.com/repos/dotnet/coreclr/milestones/9/labels","id":1876930,"number":9,"title":"1.2.0","description":".NET Core 1.2 Placeholder.  No date is set. https://github.com/dotnet/core/blob/master/roadmap.md","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars.githubusercontent.com/u/1302850?v=3","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":137,"closed_issues":171,"state":"open","created_at":"2016-07-11T20:32:48Z","updated_at":"2016-12-12T20:57:32Z","due_on":"2017-04-30T07:00:00Z","closed_at":null},"comments":2,"created_at":"2016-12-12T20:27:01Z","updated_at":"2016-12-12T21:04:53Z","closed_at":null,"body":"Example:\r\n```C#\r\nstatic void escape(ref int x)\r\n{\r\n}\r\n\r\nstatic void Test()\r\n{\r\n    int x = new int[301].Length;\r\n    escape(ref x);\r\n    if ((byte)x > 300)\r\n    {\r\n        Console.WriteLine(\"boo\");\r\n    }\r\n}\r\n```\r\nThe cast to byte is dropped by this [code](https://github.com/dotnet/coreclr/blob/master/src/jit/lowerxarch.cpp#L3626) and we get this:\r\n```asm\r\nG_M55887_IG02:\r\n       48B9AA10AA5AF97F0000 mov      rcx, 0x7FF95AAA10AA\r\n       BA2D010000           mov      edx, 301\r\n       E898D8765F           call     CORINFO_HELP_NEWARR_1_VC\r\n       8B4808               mov      ecx, dword ptr [rax+8]\r\n; int sized compare\r\n       81F92C010000         cmp      ecx, 300\r\n       7E12                 jle      SHORT G_M55887_IG03\r\n       48B96830535621020000 mov      rcx, 0x22156533068\r\n       488B09               mov      rcx, gword ptr [rcx]\r\n       E87BA6665E           call     System.Console:WriteLine(ref)\r\n```\r\nPresumably the intention of that code is to generate a byte sized compare but this doesn't happen if the constant doesn't fit in a byte."},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/266552292","html_url":"https://github.com/dotnet/coreclr/issues/8599#issuecomment-266552292","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/8599","id":266552292,"user":{"login":"RussKeldorph","id":15160879,"avatar_url":"https://avatars.githubusercontent.com/u/15160879?v=3","gravatar_id":"","url":"https://api.github.com/users/RussKeldorph","html_url":"https://github.com/RussKeldorph","followers_url":"https://api.github.com/users/RussKeldorph/followers","following_url":"https://api.github.com/users/RussKeldorph/following{/other_user}","gists_url":"https://api.github.com/users/RussKeldorph/gists{/gist_id}","starred_url":"https://api.github.com/users/RussKeldorph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RussKeldorph/subscriptions","organizations_url":"https://api.github.com/users/RussKeldorph/orgs","repos_url":"https://api.github.com/users/RussKeldorph/repos","events_url":"https://api.github.com/users/RussKeldorph/events{/privacy}","received_events_url":"https://api.github.com/users/RussKeldorph/received_events","type":"User","site_admin":false},"created_at":"2016-12-12T21:04:52Z","updated_at":"2016-12-12T21:04:52Z","body":"Thanks @mikedn!  Do you want me to assign this to you, or are you thinking the separate fix should come from someone else?\r\n\r\n@dotnet/jit-contrib \r\n"}}
{"actor":{"display_login":"RussKeldorph"}}