https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66906

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
This avoids ICE, but executable crashes:

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 0551a75..47b4f06 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -11643,7 +11643,9 @@ ix86_expand_prologue (void)

       /* For the purposes of frame and register save area addressing,
    we've started over with a new frame.  */
-      m->fs.sp_offset = INCOMING_FRAME_SP_OFFSET;
+      m->fs.sp_offset = (INCOMING_FRAME_SP_OFFSET
+         + (ix86_static_chain_on_stack
+            ? UNITS_PER_WORD : 0));
       m->fs.realigned = true;
     }

Reply via email to