]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix internal error in seh_cfa_offset with -O2 -fno-omit-frame-pointer
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 22 May 2024 16:10:39 +0000 (18:10 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Wed, 22 May 2024 16:13:54 +0000 (18:13 +0200)
commitf14ef5cfd4c1ba1d34afda9174935e40d3c0a3ce
treef7cb294a29c89489b458686df0e452c84cd86484
parenta3b16e73a2d5b2d4d20ef6f2fd164cea633bbec8
Fix internal error in seh_cfa_offset with -O2 -fno-omit-frame-pointer

The problem directly comes from the -ffold-mem-offsets pass messing up with
the prologue and the frame-related instructions, which is a no-no with SEH,
so the fix simply disconnects the pass in these circumstances.

gcc/
PR rtl-optimization/115038
* fold-mem-offsets.cc (fold_offsets): Return 0 if the defining
instruction of the register is frame related.

gcc/testsuite/
* g++.dg/opt/fmo1.C: New test.
gcc/fold-mem-offsets.cc
gcc/testsuite/g++.dg/opt/fmo1.C [new file with mode: 0644]