From: Tim Prince <timothyprince@sbcglobal.net>
To: Andrew Haley <aph@redhat.com>
Cc: Maurizio Vitale <maurizio.vitale@polymath-solutions.com>,
gcc-help@gcc.gnu.org
Subject: Re: aligned attribute
Date: Thu, 21 Dec 2006 21:21:00 -0000 [thread overview]
Message-ID: <458AFAEE.9040508@sbcglobal.net> (raw)
In-Reply-To: <17801.15520.429722.620134@zebedee.pink>
Andrew Haley wrote:
> Maurizio Vitale writes:
> > But when I move to my real application (an event-driven simulator) I
> > get stack allocated objects on 8-byte boundaries.
> >
> > Now, my reading of the documentation is that the aligned attribute
> > (when used for types, as in the example I gave) applies to all
> > allocations (global, auto and heap). Is there any place where it is
> > said otherwise? Regardless of the documentation, what does the
> > implementation do?
>
> You can't get alignment any greater than the alignment of the stack
> pointer. The alignment of the stack pointer is defined the the ABI of
> the particular target you're using. I think it's 16 for x86
> processors, but the processor itself doesn't enforce that: it varies
> across operating systems and processor variants.
It is also possible to build binutils with support for maximum alignment
less than 16. This was often done prior to widespread option of sse on
Opteron, for example. The compiler can't determine if the linker or OS
aren't supporting as large alignments as the compiler.
prev parent reply other threads:[~2006-12-21 21:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-20 13:28 Maurizio Vitale
2006-12-20 13:37 ` Andrew Haley
2006-12-20 13:52 ` Maurizio Vitale
2006-12-21 21:23 ` Tim Prince
2006-12-21 21:31 ` Maurizio Vitale
2006-12-22 12:02 ` Andrew Haley
2006-12-22 13:16 ` Maurizio Vitale
2006-12-21 21:21 ` Tim Prince [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=458AFAEE.9040508@sbcglobal.net \
--to=timothyprince@sbcglobal.net \
--cc=aph@redhat.com \
--cc=gcc-help@gcc.gnu.org \
--cc=maurizio.vitale@polymath-solutions.com \
--cc=tprince@myrealbox.com \
/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).