[Bug target/37845] gcc ignores FP_CONTRACT pragma set to OFF
vincent at vinc17 dot org
gcc-bugzilla@gcc.gnu.org
Thu Oct 16 13:56:00 GMT 2008
------- Comment #3 from vincent at vinc17 dot org 2008-10-16 13:54 -------
(In reply to comment #1)
> Confirmed. The FP_CONTRACT macro is not implemented, but the default behavior
> of GCC is to behave like it was set to OFF.
The problem is that on PowerPC, x*y+z is fused (contracted) by default (which
is forbidden when FP_CONTRACT is OFF). I could test only with Apple's gcc
4.0.1, but the man page of the gcc snapshot implies that the problem remains
with the current versions:
IBM RS/6000 and PowerPC Options
-mfused-madd
-mno-fused-madd
Generate code that uses (does not use) the floating point multiply
and accumulate instructions. These instructions are generated by
default if hardware floating is used.
But the correct behavior would be that these instructions should not be
generated by default.
On http://www.vinc17.org/software/tst-ieee754.c compiled with
gcc -Wall -O2 -std=c99 tst-ieee754.c -o tst-ieee754 -lm
I get:
$ ./tst-ieee754 | grep fused
x * y + z with FP_CONTRACT OFF is fused.
I need to add -mno-fused-madd to get the correct behavior:
$ ./tst-ieee754 | grep fused
x * y + z with FP_CONTRACT OFF is not fused.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37845
More information about the Gcc-bugs
mailing list