-
Notifications
You must be signed in to change notification settings - Fork 3.4k
frem float miscompilation #5399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It seems like f64-rem is asm2wasm binaryen stuff. Invoking function () {
"almost asm";
var STACKTOP = 0, STACK_MAX = 0;
var Math_fround=global.Math.fround;
function _foo($0,$1) {
$0 = Math_fround($0);
$1 = Math_fround($1);
var $2 = Math_fround(0), label = 0, sp = 0;
sp = STACKTOP;
$2 = Math_fround($0 % $1);
return (Math_fround($2));
}
return { _foo: _foo };
}
When used without binaryen, emscripten produces asm.js like following (minimized): function () {
"almost asm";
var STACKTOP = 0, STACK_MAX = 0;
var Math_fround=global.Math.fround;
function _foo($0,$1) {
$0 = +$0;
$1 = +$1;
var $2 = 0.0, label = 0, sp = 0;
sp = STACKTOP;
$2 = $0 % $1;
return (+$2);
}
return { _foo: _foo };
} which compiles down to nice webassembly:
I'm not an expert in emscripten/binaryen thing, but I tend to think binaryen is actual culprit here. |
Should be fixed by that binaryen PR. |
Source: rust-lang/rust#42629
Minimized example:
Gives following output (stripped):
emcc version:
The text was updated successfully, but these errors were encountered: