This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/15187] Inefficient if optimization with -O2 -ffast-math
- From: "pluto at agmk dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Mar 2006 10:34:06 -0000
- Subject: [Bug rtl-optimization/15187] Inefficient if optimization with -O2 -ffast-math
- References: <bug-15187-1649@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from pluto at agmk dot net 2006-03-28 10:34 -------
it looks like 4.1.1 and 4.2.0 still produce unoptimal code.
#include <math.h>
double test(double x)
{
if (x > 0.0)
return cos(x);
else
return sin(x);
}
[ 4.1.1-0.20060322 / rev.112277 /x86-64 ]
$ gcc bug.c -O2 -ffast-math -m32 -march=i686 -S
test: pushl %ebp
movl %esp, %ebp
fldl 8(%ebp)
fldz
fcomip %st(1), %st
jae .L2
popl %ebp
fcos
ret
.L2: popl %ebp
fsin
ret
[ 4.2.0-20060323 / rev.112317 / x86-64 ]
$ ./xgcc -B. bug.c -O2 -ffast-math -m32 -march=i686 -S
bug.c: In function ‘test’:
bug.c:7: internal compiler error: in bsi_last, at tree-flow-inline.h:760
--
pluto at agmk dot net changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pluto at agmk dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15187