]> gcc.gnu.org Git - gcc.git/commitdiff
Fix ICE with pathologically large frames
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 3 Mar 2021 11:25:03 +0000 (12:25 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Wed, 3 Mar 2021 11:33:47 +0000 (12:33 +0100)
gcc/
PR target/99234
* config/i386/i386.c (ix86_compute_frame_layout): For a SEH target,
point back the hard frame pointer to its default location when the
frame is larger than SEH_MAX_FRAME_SIZE.

gcc/config/i386/i386.c

index d33c850637a9f092c27d0faf2e3967f4c191e8d3..592455ef6d48d2eb4f54fa196420184682564b49 100644 (file)
@@ -11659,7 +11659,8 @@ ix86_compute_frame_layout (void)
       frame->hard_frame_pointer_offset = frame->sse_reg_save_offset;
 
       /* If we can leave the frame pointer where it is, do so.  Also, return
-        the establisher frame for __builtin_frame_address (0).  */
+        the establisher frame for __builtin_frame_address (0) or else if the
+        frame overflows the SEH maximum frame size.  */
       const HOST_WIDE_INT diff
        = frame->stack_pointer_offset - frame->hard_frame_pointer_offset;
       if (diff <= 255)
@@ -11677,6 +11678,8 @@ ix86_compute_frame_layout (void)
             frame that is addressable with 8-bit offsets.  */
          frame->hard_frame_pointer_offset = frame->stack_pointer_offset - 128;
        }
+      else
+       frame->hard_frame_pointer_offset = frame->hfp_save_offset;
     }
 }
 
This page took 0.079936 seconds and 5 git commands to generate.