===================================================================
@@ -1,3 +1,10 @@
+2015-10-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/67940
+ * config/i386/i386.c (ix86_compute_frame_layout): Correct
+ stack alignment adjustment.
+ (ix86_expand_prologue): Likewise.
+
2015-10-12 Uros Bizjak <ubizjak@gmail.com>
Backport from mainline
===================================================================
@@ -10222,7 +10222,7 @@ ix86_compute_frame_layout (struct ix86_f
sure that no value happens to be the same before and after, force
the alignment computation below to add a non-zero value. */
if (stack_realign_fp)
- offset = (offset + stack_alignment_needed) & -stack_alignment_needed;
+ offset = (offset + stack_alignment_needed - 1) & -stack_alignment_needed;
/* Va-arg area */
frame->va_arg_size = ix86_varargs_gpr_size + ix86_varargs_fpr_size;
@@ -11613,7 +11613,7 @@ ix86_expand_prologue (void)
pointer is no longer valid. As for the value of sp_offset,
see ix86_compute_frame_layout, which we need to match in order
to pass verification of stack_pointer_offset at the end. */
- m->fs.sp_offset = (m->fs.sp_offset + align_bytes) & -align_bytes;
+ m->fs.sp_offset = (m->fs.sp_offset + align_bytes - 1) & -align_bytes;
m->fs.sp_valid = false;
}