This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: inefficient comparison
- From: "Uros Bizjak" <ubizjak at gmail dot com>
- To: "GCC Development" <gcc at gcc dot gnu dot org>
- Cc: "Krishna Myneni" <krishnamyneni at bellsouth dot net>
- Date: Thu, 19 Oct 2006 08:16:48 +0200
- Subject: Re: inefficient comparison
Krishna Myneni <krishnamyneni@bellsouth.net> wrote:
Under "gcc (GCC) 4.1.0 (SUSE Linux)", with CFLAGS = -m32 -S, and under all of
the optimization levels (O0 through O3), the following is produced :
flds .LC2
fldz
fxch %st(1)
fucompp
fnstsw %ax
:
The FXCH instruction is unnecessary if the FLDS and FLDZ instructions were
ordered in reverse. Why does this type of optimization not take place?
This is actually PR target/15492.
And the optimization doesn't take place for the simple fact, that
nobody implemented the optimization yet. I have a prototype patch that
catches these simple opportunities.
Uros.