This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR 16660, attribute((aligned)) doesn't work for variables on the stack for greater than required alignment
- From: trevor_smigiel at playstation dot sony dot com
- To: Andrew_Pinski at PlayStation dot Sony dot Com
- Cc: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org, Russell_Olsen at PlayStation dot Sony dot com
- Date: Thu, 17 May 2007 16:49:53 -0700
- Subject: Re: [PATCH] Fix PR 16660, attribute((aligned)) doesn't work for variables on the stack for greater than required alignment
- References: <20070202234910.GB14896@redhat.com> <OF15BFC61A.42B05901-ON882572DE.000355EF-882572DE.007752F8@playstation.sony.com>
Andrew,
It seems you missed merging a change that I made in our local tree.
In cfgexpand.c, you removed this code:
- /* Set alignment we actually gave this decl. */
- offset -= frame_phase;
- align = offset & -offset;
- align *= BITS_PER_UNIT;
- if (align > STACK_BOUNDARY || align == 0)
- align = STACK_BOUNDARY;
- DECL_ALIGN (decl) = align;
- DECL_USER_ALIGN (decl) = 0;
In our local tree that code is conditioned on
if (!DECL_USER_ALIGN (decl))
(Which could be done more precisely. Consider the case where a user
specified alignment is smaller than the decl's actual alignment on the
stack.)
Without it less efficient code can be generated because higher
alignments are not propagated. At least, that's the behaviour on 4.1.1.
Trevor