public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Optimization advice for maintainers: go for low-hanging fruit
@ 2002-12-20  3:44 Martin Buchholz
  2002-12-20  8:17 ` Jan Hubicka
  2002-12-23 18:06 ` Joe Buck
  0 siblings, 2 replies; 5+ messages in thread
From: Martin Buchholz @ 2002-12-20  3:44 UTC (permalink / raw)
  To: gcc

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.

My suggestion for improving gcc's object code is not to add ever more
clever optimization passes, but simply to concentrate on making sure
that existing optimizations are applied everywhere they can be - not a
sexy job, certainly, but very likely low-hanging fruit.

My guess is that past maintainers, in a hurry to fix code generation
bugs, have fixed bugs "the wrong way" and thus disabled optimizations
in some paths through the code.

c++/8936: Declaration of never defined member function changes generated code
optimization/8952: failure to optimize away trivial C++ object creation
optimization/8967: Making class data members `const' pessimizes code
optimization/9016: Failure to consistently constant fold "constant" C++ objects

Martin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-12-24  7:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-20  3:44 Optimization advice for maintainers: go for low-hanging fruit Martin Buchholz
2002-12-20  8:17 ` Jan Hubicka
2002-12-20 11:01   ` Dan Nicolaescu
2002-12-23 18:06 ` Joe Buck
2002-12-24  6:34   ` Martin Buchholz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).