kripken/emscripten — Issue #302: Incorrect unsigned comparison
Author: jterrace
Created: 2012-03-06 21:27:26+00:00
State: open

I'm having a problem where emscripten is getting an unsigned value and then comparing it to a negative number.

Here's the JS output (relevant lines are 7 and 187):
http://paste.pocoo.org/show/562099/

Here's the LLVM output (relevant lines are 6 and 116):
http://paste.pocoo.org/show/562107/

For some reason the signed i32 load is being turned into a HEAPU32 lookup, instead of HEAP32 lookup. I tried constructing a test case, but I'm having trouble creating something that the compiler doesn't just optimize away.