This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR 16660, attribute((aligned)) doesn't work for variables on the stack for greater than required alignment


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]