This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: insufficient inline optimisation?
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: als at iinet dot net dot au (Anthony Shipman)
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 1 Nov 2005 09:25:45 -0500 (EST)
- Subject: Re: insufficient inline optimisation?
> The compiler version is 4.01 (on Fedora 4). If I compile with -O0 then the
> creation of buf results in a loop being generated which calls the Z()
> constructor 100 times.
>
> But then if I compile with -O the constructor will be inlined. The generated
> machine code contains a loop which does nothing 100 times:
> movl $100, %eax
> .L11:
> decl %eax
> jne .L11
>
> I think that the optimiser should get rid of the loop once it has got rid of
> the body!
>
> Should I submit this as a bug?
This has been fixed in 4.1.0 already. This is the normal not removing
empty loops problem which was fixed in 4.1.0.
-- Pinski