{"action":"opened","issue":{"url":"https://api.github.com/repos/LuaJIT/LuaJIT/issues/448","repository_url":"https://api.github.com/repos/LuaJIT/LuaJIT","labels_url":"https://api.github.com/repos/LuaJIT/LuaJIT/issues/448/labels{/name}","comments_url":"https://api.github.com/repos/LuaJIT/LuaJIT/issues/448/comments","events_url":"https://api.github.com/repos/LuaJIT/LuaJIT/issues/448/events","html_url":"https://github.com/LuaJIT/LuaJIT/issues/448","id":369911953,"node_id":"MDU6SXNzdWUzNjk5MTE5NTM=","number":448,"title":"Seemingly incorrect code generation with JIT enabled","user":{"login":"gonzalezjo","id":22648562,"node_id":"MDQ6VXNlcjIyNjQ4NTYy","avatar_url":"https://avatars2.githubusercontent.com/u/22648562?v=4","gravatar_id":"","url":"https://api.github.com/users/gonzalezjo","html_url":"https://github.com/gonzalezjo","followers_url":"https://api.github.com/users/gonzalezjo/followers","following_url":"https://api.github.com/users/gonzalezjo/following{/other_user}","gists_url":"https://api.github.com/users/gonzalezjo/gists{/gist_id}","starred_url":"https://api.github.com/users/gonzalezjo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonzalezjo/subscriptions","organizations_url":"https://api.github.com/users/gonzalezjo/orgs","repos_url":"https://api.github.com/users/gonzalezjo/repos","events_url":"https://api.github.com/users/gonzalezjo/events{/privacy}","received_events_url":"https://api.github.com/users/gonzalezjo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-14T15:15:44Z","updated_at":"2018-10-14T15:15:44Z","closed_at":null,"author_association":"NONE","body":"I'm unsure if LuaJIT intentionally avoids IEEE float compliance a la ffast-math as an optimization. If it does, that might explain the behavior being observed, and this would be a non-issue. If it does not, I believe this is a bug. The code given has different behavior with the JIT on, versus off.\r\n\r\n\r\n```lua\r\nlocal terms, distinct, i = \r\n  {}, {}, 0\r\n\r\nfor a = 25, 81 do \r\n  for b = 25, 81 do \r\n    i = i + 1\r\n    terms[i] = a ^ b\r\n  end\r\nend\r\n\r\ni = 0 \r\nfor j = 1, #terms do \r\n  local term = terms[j]\r\n\r\n  if not distinct[term] then \r\n    i = i + 1\r\n    distinct[term] = true\r\n  end\r\nend\r\n\r\nprint(i)\r\n```\r\n\r\n\r\nwith jit.off() before the first for loop, the script will print out `3228`. Without jit.off(), it will print out `3239`, which is a nonsensical answer. Is this intentional behavior? "}}
{"actor":{"display_login":"gonzalezjo"}}