public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Buchholz <martin@xemacs.org>
To: gcc@gcc.gnu.org
Subject: Optimization advice for maintainers: go for low-hanging fruit
Date: Fri, 20 Dec 2002 03:44:00 -0000	[thread overview]
Message-ID: <15874.46305.491247.297301@wobble.local> (raw)

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

             reply	other threads:[~2002-12-20  6:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-20  3:44 Martin Buchholz [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15874.46305.491247.297301@wobble.local \
    --to=martin@xemacs.org \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).