{"action":"created","issue":{"url":"https://api.github.com/repos/kripken/emscripten/issues/3154","labels_url":"https://api.github.com/repos/kripken/emscripten/issues/3154/labels{/name}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/3154/comments","events_url":"https://api.github.com/repos/kripken/emscripten/issues/3154/events","html_url":"https://github.com/kripken/emscripten/issues/3154","id":55588799,"number":3154,"title":"js-optimizer emits empty if clauses","user":{"login":"coolwanglu","id":734614,"avatar_url":"https://avatars.githubusercontent.com/u/734614?v=3","gravatar_id":"","url":"https://api.github.com/users/coolwanglu","html_url":"https://github.com/coolwanglu","followers_url":"https://api.github.com/users/coolwanglu/followers","following_url":"https://api.github.com/users/coolwanglu/following{/other_user}","gists_url":"https://api.github.com/users/coolwanglu/gists{/gist_id}","starred_url":"https://api.github.com/users/coolwanglu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolwanglu/subscriptions","organizations_url":"https://api.github.com/users/coolwanglu/orgs","repos_url":"https://api.github.com/users/coolwanglu/repos","events_url":"https://api.github.com/users/coolwanglu/events{/privacy}","received_events_url":"https://api.github.com/users/coolwanglu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-27T08:24:39Z","updated_at":"2015-01-27T22:41:25Z","closed_at":null,"body":"I managed to isolated the affected function:\r\n\r\n```\r\n// emcc-4-meminit.js\r\nfunction _did_set_title__async_cb($0) {\r\n $0 = $0|0;\r\n var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;\r\n sp = STACKTOP;\r\n $1 = (($0) + 4|0);\r\n $2 = HEAP32[$1>>2]|0;\r\n $3 = ($2|0)==(0);\r\n if ($3) {\r\n  $6 = HEAP32[122104>>2]|0;\r\n  $7 = ($6|0)==(0);\r\n  if ($7) {\r\n  }\r\n } else {\r\n  $4 = HEAP32[121416>>2]|0;\r\n  $5 = ($4|0)==(0);\r\n  if ($5) {\r\n  }\r\n }\r\n STACKTOP = sp;return;\r\n}\r\n\r\n// emcc-5-js_opts.js\r\nfunction Oqa(a){a=a|0;var b=0;b=i;if(!(c[a+4>>2]|0))else i=b;return}\r\n```\r\n\r\nThis function is an async callback generated by ASYNCIFY, and it happens that the function does nothing.\r\nNot sure why LLVM did not optimize this, but this looks like a bug in js-optimizer."},"comment":{"url":"https://api.github.com/repos/kripken/emscripten/issues/comments/71743878","html_url":"https://github.com/kripken/emscripten/issues/3154#issuecomment-71743878","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/3154","id":71743878,"user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"created_at":"2015-01-27T22:41:25Z","updated_at":"2015-01-27T22:41:25Z","body":"Should be fixed now, please verify."}}