On 2/10/19 6:09 PM, Hans-Peter Nilsson wrote: > Here's the follow-up, getting rid of the observed > alignment-padding in execute/930126-1.c: the x parameter in f > spuriously being runtime-aligned to BITS_PER_WORD. I separated > this change because this is an older issue, a change introduced > in r94104 where BITS_PER_WORD was chosen perhaps because we > expect register-sized writes into this area. Here, we instead > align to a minimum of PREFERRED_STACK_BOUNDARY, but of course > gated on ! STRICT_ALIGNMENT. > > Regtested cris-elf and x86_64-pc-linux-gnu. > > Ok to commit? > > gcc: > * function.c (assign_parm_setup_block): If not STRICT_ALIGNMENT, > instead of always BITS_PER_WORD, align the stacked > parameter to a minimum PREFERRED_STACK_BOUNDARY. Interestingly enough in the thread from 2005 Richard S suggests that he could have made increasing the alignment conditional on STRICT_ALIGNMENT but thought that with the size already being rounded up it wasn't worth it and that we could take advantage of the increased alignment elsewhere.
I wonder if we could just go back to that idea. Leave the alignment as DECL_ALIGN for !STRICT_ALIGNMENT targets and bump it up for STRICT_ALIGNMENT targets? So something like align = STRICT_ALIGNMENT ? MAX (DECL_ALIGN (parm), BITS_PER_WORD) : DECL_ALIGN (parm) Jeff