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.

--- function.c.orig2    Sat Feb  9 00:53:17 2019
+++ function.c  Sat Feb  9 23:21:35 2019
@@ -2912,7 +2912,10 @@ assign_parm_setup_block (struct assign_p
   size_stored = CEIL_ROUND (size, UNITS_PER_WORD);
   if (stack_parm == 0)
     {
-      SET_DECL_ALIGN (parm, MAX (DECL_ALIGN (parm), BITS_PER_WORD));
+      HOST_WIDE_INT min_parm_align
+       = STRICT_ALIGNMENT ? BITS_PER_WORD : PREFERRED_STACK_BOUNDARY;
+
+      SET_DECL_ALIGN (parm, MAX (DECL_ALIGN (parm), min_parm_align));
       if (DECL_ALIGN (parm) > MAX_SUPPORTED_STACK_ALIGNMENT)
        {
          rtx allocsize = gen_int_mode (size_stored, Pmode);

brgds, H-P

Reply via email to