-
Notifications
You must be signed in to change notification settings - Fork 733
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
wasm2c/spec/float_exprs.txt test fails with GCC 15 on ppc64le and s390x #2542
Comments
at first glance, this looks like a GCC bug. |
Ok, gcc bug opened: https://bugzilla.redhat.com/show_bug.cgi?id=2346233 . Could you help prepare a minimum piece of code to reproduce the issue and help gcc maintainers fix it? |
test/wasm2c/spec/float_exprs.txt points to https://github.com/WebAssembly/testsuite/blob/eeb6dac81be81151da0958ed955aba91230c1f25/float_exprs.wast#L2269 for the offending code, but how this is translated to a C code that GCC consumes is magic to me :-) Although maybe I am getting somewhere ... |
with reduced
|
does this exhibit the problem? /* min.c */
typedef uint32_t u32;
typedef float f32;
u32 w2c_float__exprs__88__wasm_f320x2Eno_trichotomy_lt_0(void* instance, f32 var_p0, f32 var_p1) {
u32 var_i0, var_i1;
f32 var_f0, var_f1, var_f2;
var_f0 = var_p0;
var_f1 = var_p1;
var_i0 = var_f0 < var_f1;
var_f1 = var_p0;
var_f2 = var_p1;
var_i1 = var_f1 >= var_f2;
var_i0 |= var_i1;
return var_i0;
} /* main.c */
#include <string.h>
typedef uint32_t u32;
typedef float f32;
u32 w2c_float__exprs__88__wasm_f320x2Eno_trichotomy_lt_0(void* instance, f32 var_p0, f32 var_p1);
static f32 make_nan_f32(u32 x) {
x |= 0x7f800000;
f32 res;
memcpy(&res, &x, sizeof(res));
return res;
}
int main(int argc, char **argv) {
return w2c_float__exprs__88__wasm_f320x2Eno_trichotomy_lt_0(NULL, 0.f, make_nan_f32(0x400000));
} (compile with same flags and whatnot ofc, feel free to rename the function the name clearly doesn't matter) |
It does not AFAICT, but often there is more code required "surrounding" the minimal code snippets, so the compiler makes different decisions. I believe I should be able to reduce my example above to have something useful for the toolchains team. |
we assume you did check the exit status? it doesn't output anything other than the exit status, but that might have been unclear, sorry. |
sorry, I haven't read the code :-) Is return code |
indeed, it's supposed to return 0. |
it can be minimized further, but you can probably do that a lot easier now. |
and compiled with |
@SoniEx2 your assistance is much appreciated! Could you take a look at other failed test issues I opened? |
I am getting this on s390x, too. |
btw, does |
it does And I am confirming the s390x failure. |
GCC, that's not how floats work 🤦🏻♀️ thanks for confirming! |
When building wabt-1.0.36 with GCC 15 (Fedora 42 and rawhide) and running the testsuite on ppc64le
This does not happen with GCC 14.x and is not reproducible on x86_64 or aarch64.
The text was updated successfully, but these errors were encountered: