@@ -5139,6 +5139,10 @@ store_one_arg (struct arg_data *arg, rtx
ARGS_SIZE_RTX (arg->locate.offset),
reg_parm_stack_space,
ARGS_SIZE_RTX (arg->locate.alignment_pad), false);
+ else if ((arg->locate.alignment_pad.var
+ || maybe_ne (arg->locate.alignment_pad.constant, 0))
+ && !argblock)
+ anti_adjust_stack (ARGS_SIZE_RTX (arg->locate.alignment_pad));
/* Unless this is a partially-in-register argument, the argument is now
in the stack.
@@ -0,0 +1,15 @@
+/* PR middle-end/104558 */
+/* { dg-do compile } */
+/* { dg-options "-fabi-version=9" } */
+
+struct __attribute__ ((aligned)) A {};
+
+struct A a;
+
+void bar (int, int, int, int, int, int, int, struct A);
+
+void
+foo (void)
+{
+ bar (0, 1, 2, 3, 4, 5, 6, a);
+}