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 middle-end/46894


> I think that you shouldn't change the behaviour of alignment wrt
> STACK_POINTER_OFFSET.  So far, all targets do have (sp+S_P_O) with
> the required alignment.
>
> What about
>
>   must_align = (crtl->preferred_stack_boundary < required_align);
>   if (STACK_POINTER_OFFSET * BITS_PER_UNIT % required_align)
>     must_align = true;
>
>   if (must_align)
>     {
>       if (required_align > P_S_B)
> 	...
>     }
>
> #ifdef STACK_DYNAMIC_OFFSET
>   /* ??? S_D_O will not be finalized until we've finished expanding the
>      function.  It would be nice to know what minimum alignment we might
>      assume.  E.g. PUSH_ROUNDING or something.  */
>   must_align = true;
>   extra_align = BITS_PER_UNIT;
> #endif
>
>   if (must_align)
>     {
>       unsigned extra = ...

Fine with me, but an explicit ack from a RM would probably be in order because 
you're changing the behavior for all targets where STACK_DYNAMIC_OFFSET isn't 
defined, i.e. all of them except for PPC, PA and s390; the default definition 
of STACK_DYNAMIC_OFFSET in function.c doesn't seem to guarantee that it will 
always maintain PREFERRED_STACK_BOUNDARY alignment.

-- 
Eric Botcazou


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