linux-gcc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michel Lespinasse <walken@zoy.org>
To: Denis Zaitsev <zzz@anda.ru>
Cc: gcc@gcc.gnu.org, linux-gcc@vger.kernel.org
Subject: Re: Why -fPIC stops some optimization?
Date: Sun, 11 Jul 2004 15:28:47 -0700	[thread overview]
Message-ID: <20040711222846.GA16559@zoy.org> (raw)
In-Reply-To: <20040710035800.D7162@natasha.ward.six>

On Sat, Jul 10, 2004 at 03:58:01AM +0600, Denis Zaitsev wrote:
> > Try making __n a const and see if it helps. Yes, this is something
> > that gcc should really figure it out by itself.
> 
> This is the same way I'm curing the problem for now.  Making the subst
> variable const or using (z) directly in a statement-expression really
> helps.  But, nevertheless, is this limitation is switch operator
> specific?  Or is it a limit for optimization GCC can do, and it's
> reached faster when the PIC-code is generated?  Or what's wrong?

I can't really help you on this one - I'm just another gcc user.

All I know is, sometimes (often) gcc fails to see that some variable
is only assigned a constant once and never touched anywhere else, and
fails to optimize out that variable as a constant expression. When I
notice this, it's usualy possible to work around the issue by making
that variable a const. I have no idea why gcc does not notice the
obvious by itself though.

Cheers,

-- 
Michel "Walken" Lespinasse
"In this time of war against Osama bin Laden and the oppressive
Taliban regime, we are thankful that OUR leader isn't the spoiled son
of a powerful politician from a wealthy oil family who is supported by
religious fundamentalists, operates through clandestine organizations,
has no respect for the democratic electoral process, bombs innocents,
and uses war to deny people their civil liberties." --The Boondocks

      reply	other threads:[~2004-07-11 22:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-09 15:02 Why -fPIC stops some optimization? Denis Zaitsev
2004-07-09 20:45 ` Michel Lespinasse
2004-07-09 21:58   ` Denis Zaitsev
2004-07-11 22:28     ` Michel Lespinasse [this message]

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=20040711222846.GA16559@zoy.org \
    --to=walken@zoy.org \
    --cc=gcc@gcc.gnu.org \
    --cc=linux-gcc@vger.kernel.org \
    --cc=zzz@anda.ru \
    /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 NNTP newsgroup(s).