From 7d6330afaed79c1265a5f0cb40f254bc76e776b6 Mon Sep 17 00:00:00 2001 From: Christopher Wellons Date: Mon, 10 Jun 2024 17:54:14 -0400 Subject: [PATCH] GCC 14 seh_cfa_offset regression fix (#138) --- src/gcc-seh_cfa_offset.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/gcc-seh_cfa_offset.patch diff --git a/src/gcc-seh_cfa_offset.patch b/src/gcc-seh_cfa_offset.patch new file mode 100644 index 0000000..25f6e1d --- /dev/null +++ b/src/gcc-seh_cfa_offset.patch @@ -0,0 +1,19 @@ +commit 2f0e0862406a17bb8bf4ad948ae22916bae092a0 +Author: Eric Botcazou +Date: Wed May 22 18:10:39 2024 +0200 + + 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. + + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115038 + +--- a/gcc/fold-mem-offsets.cc ++++ b/gcc/fold-mem-offsets.cc +@@ -493,3 +493,3 @@ fold_offsets (rtx_insn *insn, rtx reg, bool analyze, bitmap foldable_insns) + +- if (!def || GET_CODE (PATTERN (def)) != SET) ++ if (!def || RTX_FRAME_RELATED_P (def) || GET_CODE (PATTERN (def)) != SET) + return 0;