All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Zaitsev <zzz@anda.ru>
To: Michel Lespinasse <walken@zoy.org>
Cc: gcc@gcc.gnu.org, linux-gcc@vger.kernel.org
Subject: Re: Why -fPIC stops some optimization?
Date: Sat, 10 Jul 2004 03:58:01 +0600	[thread overview]
Message-ID: <20040710035800.D7162@natasha.ward.six> (raw)
In-Reply-To: <20040709204550.GA1962@zoy.org>; from walken@zoy.org on Fri, Jul 09, 2004 at 01:45:50PM -0700

On Fri, Jul 09, 2004 at 01:45:50PM -0700, Michel Lespinasse wrote:
> On Fri, Jul 09, 2004 at 09:02:30PM +0600, Denis Zaitsev wrote:
> > I have met such a behaviour while compiling GLIBC for x86.  A
> > construct which suffers looks like:
> > 
> > 
> > #define __xyz(x,y,z) ({ \
> >     ...                 \
> >     size_t __n= (z);    \
> >     ...                 \
> >     switch (__n) {      \
> >         case ...        \
> >         ...             \
> >     }                   \
> >     ...                 \
> > })
> 
> I can not comment about your specific case, but in the past I've had a
> fairly similar issue with an inline function that had branches and was
> supposed to be optimized out to straight-line code at the call site.
> 
> 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?

  reply	other threads:[~2004-07-09 21:58 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 [this message]
2004-07-11 22:28     ` Michel Lespinasse

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=20040710035800.D7162@natasha.ward.six \
    --to=zzz@anda.ru \
    --cc=gcc@gcc.gnu.org \
    --cc=linux-gcc@vger.kernel.org \
    --cc=walken@zoy.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.