public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: James E Wilson <wilson@tuliptree.org>
To: linux-ia64@vger.kernel.org
Subject: Re: Simulator bootloader fails with gcc 4
Date: Wed, 20 Jul 2005 22:34:16 +0000	[thread overview]
Message-ID: <1121898856.27487.44.camel@aretha.corp.specifix.com> (raw)
In-Reply-To: <20050720053139.GC13188@cse.unsw.EDU.AU>

On Tue, 2005-07-19 at 22:31, Ian Wienand wrote:
> After some investigation I believe this is do with differences between
> the alignment of variables on the stack between gcc 3 and 4 and the
> ski simulator.

There has been no change to the natural alignment for the variable
here.  It has always been 4 bytes.  There has been a change to the
placement of variables into stack slots.  This stuff was completely
written as part of the tree-ssa work.

If gcc-3.4 and earlier, some structures (BLKmode structures) were being
over-aligned when allocated to stack slots.  They always got the maximum
alignment (16 bytes for IA-64) instead of their natural alignment.  It
isn't clear why.  I think this was an accident of implementation.  We
were basing variable alignment on modes instead of type alignment, and
since some BLKmode structures do require max alignment, we had to give
it to all of them.

In gcc-4.0, we get this right.  The variable/type alignment is used to
determine the stack alignment needed.  If the alignment is less than the
stack slot size, then we don't pad to the next stack slot regardless of
the size or type or mode of the variable.  We only pad to the alignment
boundary.  This results in smaller frame sizes.  In this case though, we
end up with the structure being allocated across two stack slots, even
though it would fit in one.  Again, I think this is an accident of
implementation.  We might get better code if this structure was
allocated to a single stack slot, as then we could use ld8/st8 to move
it around.  This would be at the expense of a small increase in frame
size in general, though we would still have smaller frames than gcc-3.4
and earlier.  Probably no one has considered this issue because no one
has noticed it before.



  reply	other threads:[~2005-07-20 22:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-20  5:31 Simulator bootloader fails with gcc 4 Ian Wienand
2005-07-20 22:34 ` James E Wilson [this message]
2005-07-22  4:58 ` Ian Wienand
2005-07-22  6:00 ` david mosberger
2005-08-15  1:49 ` Ian Wienand
2005-08-16 22:46 ` Luck, Tony
2005-08-18  0:53 ` Ian Wienand
2005-08-18 13:25 ` Stephane Eranian
2005-08-18 18:57 ` Luck, Tony
2005-08-18 19:07 ` Stephane Eranian
2005-08-18 23:14 ` Peter Chubb
2005-08-18 23:41 ` Stephane Eranian
2005-08-18 23:58 ` Peter Chubb
2005-08-19 11:33 ` Stephane Eranian
2005-08-19 23:13 ` Peter Chubb
2005-08-19 23:43 ` Stephane Eranian
2005-08-19 23:55 ` Peter Chubb
2005-08-22 13:00 ` Gerald Pfeifer
2005-08-22 22:16 ` Andreas Schwab

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=1121898856.27487.44.camel@aretha.corp.specifix.com \
    --to=wilson@tuliptree.org \
    --cc=linux-ia64@vger.kernel.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