Optimization advice for maintainers: go for low-hanging fruit
Dan Nicolaescu
dann@godzilla.ics.uci.edu
Fri Dec 20 11:01:00 GMT 2002
Jan Hubicka <jh@suse.cz> writes:
> > I've been staring at a lot of g++-generated x86 assembler, trying to
> > coax g++ into creating better code, and creating a bunch of
> > optimization-related PRs. Overall, I'm disappointed by gcc's ability
> > to optimize some very simple things like constant-folding.
> >
> > The most distressing thing about the failures is that gcc is
> > invariably capable of performing all the optimizations I care about,
> > just not consistently. Seemingly irrelevant random features of the
> > source code seem to inhibit optimizations from being performed.
>
> Can you send some testcases where GCC fails to do the transformation?
Look at the audit trail for PR8967, the example there shows that life
analysis fails to eliminate some insns in one case.
Also please take a look at PR9016, the 4 functions in that generate
the same (optimal) assembly on SPARC, but some of them don't get
optimized well on x86.
More information about the Gcc
mailing list