diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2021-03-03 12:25:03 +0100 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2021-03-03 12:29:15 +0100 |
commit | 357c4350680bf29f0c7a115424e3da11c53b5582 (patch) | |
tree | ce45975be0ea7ddf232969108328480bc6f5f179 | |
parent | f1b13064609a41fcaf4d1859663453bba237e277 (diff) | |
download | gcc-357c4350680bf29f0c7a115424e3da11c53b5582.zip gcc-357c4350680bf29f0c7a115424e3da11c53b5582.tar.gz gcc-357c4350680bf29f0c7a115424e3da11c53b5582.tar.bz2 |
Fix ICE with pathologically large frames
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.
-rw-r--r-- | gcc/config/i386/i386.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index e85b06b..6672da5 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6660,7 +6660,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) @@ -6678,6 +6679,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; } } |