{"action":"opened","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/6238","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/6238/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/6238/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/6238/events","html_url":"https://github.com/dotnet/coreclr/issues/6238","id":165130551,"number":6238,"title":"RyuJIT x86: Silent bad codegen in signed genCompareLong ","user":{"login":"adiaaida","id":9666644,"avatar_url":"https://avatars.githubusercontent.com/u/9666644?v=3","gravatar_id":"","url":"https://api.github.com/users/adiaaida","html_url":"https://github.com/adiaaida","followers_url":"https://api.github.com/users/adiaaida/followers","following_url":"https://api.github.com/users/adiaaida/following{/other_user}","gists_url":"https://api.github.com/users/adiaaida/gists{/gist_id}","starred_url":"https://api.github.com/users/adiaaida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adiaaida/subscriptions","organizations_url":"https://api.github.com/users/adiaaida/orgs","repos_url":"https://api.github.com/users/adiaaida/repos","events_url":"https://api.github.com/users/adiaaida/events{/privacy}","received_events_url":"https://api.github.com/users/adiaaida/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-12T17:10:21Z","updated_at":"2016-07-12T17:10:21Z","closed_at":null,"body":"We have a silent bad codegen bug with signed compare. Currently, we do an unsigned set after possibly doing a signed compare/jump from the hi comparison:\r\n\r\ncmp      edx, esi\r\njg          SHORT G_M17400_IG04\r\njne        SHORT G_M17400_IG04\r\ncmp      eax, ecx\r\n\r\nG_M17400_IG04:\r\nsetb     al\r\n\r\nIn a signed comparison, the hi operation needs a signed set, and the lo operation needs an unsigned set.\r\n\r\nTest case that generates this bad code:\r\n\r\n   [MethodImplAttribute(MethodImplOptions.NoInlining)]\r\n   public static int compareLong(long a, long b)\r\n   {\r\n       if (a < b)\r\n           return 5;\r\n       else\r\n           return 0;\r\n   }\r\n   public static int Main()\r\n   {\r\n       long a = -2L;\r\n       long b = 0L;\r\n       int c = compareLong(a, b);\r\n\r\n       if (c == 5)\r\n           return 100;\r\n       else\r\n            return 0;\r\n   }"}}
{"actor":{"display_login":"adiaaida"}}