public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed, PATCH] [gcc-5-branch] Wrong stack alignment adjustment
@ 2015-10-12 17:38 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2015-10-12 17:38 UTC (permalink / raw)
  To: gcc-patches

Committed as an obvious fix.

H.J.
---
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog	(revision 228731)
+++ gcc/ChangeLog	(working copy)
@@ -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
Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c	(revision 228731)
+++ gcc/config/i386/i386.c	(working copy)
@@ -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;
     }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-12 17:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-12 17:38 [committed, PATCH] [gcc-5-branch] Wrong stack alignment adjustment H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).