This is the mail archive of the gcc@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]

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.


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