This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/17578] Missed optimization--failure of gcc.c-torture/execute/ieee/compare-fp-3.c at -O1 and above


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]