https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97653
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #9) > [test@ibm-p8-cluster-02 ~]$ cat 97653.c > int printf(const char*, ...); > > const unsigned long k = 256; > > int main() > { > long double r[] = { 0.1L, 0.2L, 0.5L, 0.9L }; > for (int i = 0; i < 4; ++i) > { > unsigned long j = k * r[i]; > printf("%lu * %Lf = %lu\n", k, r[i], j); > } > } > [test@ibm-p8-cluster-02 ~]$ ~/gcc/ieee/bin/gcc 97653.c -mno-gnu-attribute > -mabi=ibmlongdouble -Wall -static-libgcc -v && ./a.out > Using built-in specs. > COLLECT_GCC=/home/test/gcc/ieee/bin/gcc > COLLECT_LTO_WRAPPER=/home/test/gcc/ieee/libexec/gcc/powerpc64le-unknown- > linux-gnu/11.0.1/lto-wrapper > Target: powerpc64le-unknown-linux-gnu > Configured with: /home/test/src/gcc/configure --prefix=/home/test/gcc/ieee > --disable-multilib --disable-bootstrap --enable-languages=c++ --disable-pch > --disable-nls --without-isl --with-long-double-format=ieee : (reconfigured) > /home/test/src/gcc/configure --prefix=/home/test/gcc/ieee --disable-multilib > --disable-bootstrap --enable-languages=c++ --disable-pch --disable-nls > --without-isl --with-long-double-format=ieee Is your compiler intentionally configured without --with-long-double-128, i.e. are you intentionally testing the double == long double case? I can reproduce the weirdo output only when I build with such configured cross-compiler (without -mlong-double-128) and link on gcc112 on CompilerFarm with the system compiler (which defaults to -mlong-double-128).