From: Eric Botcazou Date: Wed, 3 Mar 2021 11:25:03 +0000 (+0100) Subject: Fix ICE with pathologically large frames X-Git-Tag: releases/gcc-10.3.0~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2939b358936bb824330888def98ad848dea41483;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 7b8036613664..e23f92b58cc0 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6357,7 +6357,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) @@ -6375,6 +6376,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; } }