This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/17578] Missed optimization--failure of gcc.c-torture/execute/ieee/compare-fp-3.c at -O1 and above
- From: "danglin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Sep 2004 04:33:15 -0000
- Subject: [Bug tree-optimization/17578] Missed optimization--failure of gcc.c-torture/execute/ieee/compare-fp-3.c at -O1 and above
- References: <20040921015638.17578.danglin@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From danglin at gcc dot gnu dot org 2004-09-21 04:33 -------
> The generated code for this function is ok. It's just not optimized.
> As far as I can tell, neither comparison should trap, so -ftrapping-math
> shouldn't affect the optimization.
I take this back. The compares can trap if x or y is a signalling NaN.
Thus, the compares can't be optimized without -fno-trapping-math.
I see gcc.c-torture/execute/ieee/compare-fp-3.x tries to set -fno-trapping-math
but it doesn't work. For example,
Executing on host: /home/dave/gnu/gcc-4.0/objdir/gcc/xgcc -B/home/dave/gnu/gcc-4
.0/objdir/gcc/ /home/dave/gnu/gcc-4.0/gcc/gcc/testsuite/gcc.c-torture/execute/ie
ee/compare-fp-3.c -w -O1 -ffloat-store -lm -o /home/dave/gnu/gcc-4.0/objdi
r/gcc/testsuite/compare-fp-3.x1 (timeout = 300)
PASS: gcc.c-torture/execute/ieee/compare-fp-3.c compilation, -O1
PASS: gcc.c-torture/execute/ieee/compare-fp-3.c execution, -O1
On x86, link_error0 get optimized away in the compare-fp-3.c.16.life
pass.
There seems to be a bunch of bugs here. We have link_error0 being
optimized away in test2 and test3 during tree optimization when
-fno-trapping-math is not set. link_error0 is also being optimized
away in the life pass on x86 with -fno-trapping-math not set. The
test isn't using the -fno-trapping-math.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17578