===================================================================
@@ -0,0 +1,10 @@
+/* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */
+/* { dg-options "-O -mabi=ms -mstackrealign" } */
+
+typedef float V __attribute__ ((vector_size (16)));
+
+int fn1 (V * x)
+{
+ V a = *x;
+ return a[0];
+}
===================================================================
@@ -11271,11 +11271,14 @@ ix86_compute_frame_layout (struct ix86_frame *fram
frame->nregs = ix86_nsaved_regs ();
frame->nsseregs = ix86_nsaved_sseregs ();
- /* 64-bit MS ABI seem to require stack alignment to be always 16 except for
- function prologues and leaf. */
+ /* 64-bit MS ABI seem to require stack alignment to be always 16,
+ except for function prologues, leaf functions and when the defult
+ incoming stack boundary is overriden at command line or via
+ force_align_arg_pointer attribute. */
if ((TARGET_64BIT_MS_ABI && crtl->preferred_stack_boundary < 128)
&& (!crtl->is_leaf || cfun->calls_alloca != 0
- || ix86_current_function_calls_tls_descriptor))
+ || ix86_current_function_calls_tls_descriptor
+ || ix86_incoming_stack_boundary < 128))
{
crtl->preferred_stack_boundary = 128;
crtl->stack_alignment_needed = 128;