This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/30826] alignment error when optimizing with inlining
- From: "sje at cup dot hp dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Feb 2007 17:06:44 -0000
- Subject: [Bug target/30826] alignment error when optimizing with inlining
- References: <bug-30826-9385@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from sje at cup dot hp dot com 2007-02-20 17:06 -------
I did mean 256 bits and not bytes in comment #5.
Forcing -fno-inline wouldn't necessarily help, the compiler is forcing the
return structure to be 4 byte aligned and it is going to be a 50/50 proposition
whether or not it also gets 8 byte aligned by chance. Any optimization that
changed the layout of local variables could affect the alignment of the return
structure (which might be the local variable or might be a temporary created by
GCC).
I was able to workaround the bug in inline.c by putting
__attribute__ ((aligned(16)))
on the declaration of mi.
This should work as long as GCC doesn't need to create a temporary for the
return value being returned and puts it directly in the mi variable. If it
creates a temporary there is no way to control the alignment used.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30826