{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/10377","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/10377/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/10377/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/10377/events","html_url":"https://github.com/JuliaLang/julia/issues/10377","id":59502482,"number":10377,"title":"LLVM 3.6 giving incorrectly signed zeros","user":{"login":"simonbyrne","id":1692009,"avatar_url":"https://avatars.githubusercontent.com/u/1692009?v=3","gravatar_id":"","url":"https://api.github.com/users/simonbyrne","html_url":"https://github.com/simonbyrne","followers_url":"https://api.github.com/users/simonbyrne/followers","following_url":"https://api.github.com/users/simonbyrne/following{/other_user}","gists_url":"https://api.github.com/users/simonbyrne/gists{/gist_id}","starred_url":"https://api.github.com/users/simonbyrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonbyrne/subscriptions","organizations_url":"https://api.github.com/users/simonbyrne/orgs","repos_url":"https://api.github.com/users/simonbyrne/repos","events_url":"https://api.github.com/users/simonbyrne/events{/privacy}","received_events_url":"https://api.github.com/users/simonbyrne/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/upstream","name":"upstream","color":"bbbbbb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-03-02T16:13:22Z","updated_at":"2015-03-06T13:54:42Z","closed_at":null,"body":"Using LLVM 3.6, branches involving comparison to zero can sometimes return the incorrect sign.\r\n\r\nThis has come up in https://github.com/JuliaLang/julia/issues/9336#issuecomment-76627292 and https://github.com/JuliaLang/julia/pull/9880#issuecomment-72192137.\r\n\r\nHere is a minimal example:\r\n```julia\r\njulia> versioninfo()\r\nJulia Version 0.4.0-dev+3639\r\nCommit 7f7e9ae (2015-03-01 22:49 UTC)\r\nPlatform Info:\r\n  System: Linux (x86_64-linux-gnu)\r\n  CPU: Intel(R) Xeon(R) CPU E7- 8850  @ 2.00GHz\r\n  WORD_SIZE: 64\r\n  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)\r\n  LAPACK: libopenblas\r\n  LIBM: libopenlibm\r\n  LLVM: libLLVM-3.6.0\r\n\r\njulia> function foo(x,y)\r\n           if x==y==0\r\n               return y\r\n           end\r\n           y+1\r\n       end\r\nfoo (generic function with 1 method)\r\n\r\njulia> foo(0.0,-0.0)\r\n0.0\r\n```\r\n\r\nAnd the `@code_llvm foo(0.0,-0.0)`:\r\n```\r\ndefine double @julia_foo_42667(double, double) {\r\ntop:\r\n  call void @llvm.dbg.value(metadata double %0, i64 0, metadata !10, metadata !16)\r\n  call void @llvm.dbg.value(metadata double %1, i64 0, metadata !17, metadata !16)\r\n  %2 = fcmp une double %0, %1, !dbg !18\r\n  br i1 %2, label %L3, label %L1, !dbg !18\r\n\r\nL1:                                               ; preds = %top\r\n  call void @llvm.dbg.value(metadata double 0.000000e+00, i64 0, metadata !20, metadata !16)\r\n  %phitmp = fcmp une double %0, 0.000000e+00, !dbg !18\r\n  br i1 %phitmp, label %L3, label %if2, !dbg !18\r\n\r\nif2:                                              ; preds = %L1\r\n  ret double %0, !dbg !21\r\n\r\nL3:                                               ; preds = %top, %L1\r\n  %3 = fadd double %1, 1.000000e+00, !dbg !22\r\n  ret double %3, !dbg !22\r\n}\r\n```\r\nThe problem here is that the `if2` label it is returning `%0` instead of `%1`."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/77561548","html_url":"https://github.com/JuliaLang/julia/issues/10377#issuecomment-77561548","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/10377","id":77561548,"user":{"login":"mbauman","id":154641,"avatar_url":"https://avatars.githubusercontent.com/u/154641?v=3","gravatar_id":"","url":"https://api.github.com/users/mbauman","html_url":"https://github.com/mbauman","followers_url":"https://api.github.com/users/mbauman/followers","following_url":"https://api.github.com/users/mbauman/following{/other_user}","gists_url":"https://api.github.com/users/mbauman/gists{/gist_id}","starred_url":"https://api.github.com/users/mbauman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbauman/subscriptions","organizations_url":"https://api.github.com/users/mbauman/orgs","repos_url":"https://api.github.com/users/mbauman/repos","events_url":"https://api.github.com/users/mbauman/events{/privacy}","received_events_url":"https://api.github.com/users/mbauman/received_events","type":"User","site_admin":false},"created_at":"2015-03-06T13:54:42Z","updated_at":"2015-03-06T13:54:42Z","body":"Isn't it just likely to be an optimization pass bug? Perhaps try disabling all the optimizations and see if it persists. "}}