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: "uros at kss-loka dot si" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Mar 2006 14:08:30 -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 #12 from uros at kss-loka dot si 2006-03-29 14:08 -------
(In reply to comment #11)
> it looks like 4.1.1 and 4.2.0 still produce unoptimal code.
> 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
No, this code is optimal. Please compare the code above to the code in
description, where fcos is calculated even if x <= 0.0
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15187