aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2022-06-28 13:08:33 +0200
committerRichard Biener <rguenther@suse.de>2022-06-29 11:14:34 +0200
commit0282c4acf720e4cc073cf95594aa890444c5ca82 (patch)
tree8bb590df555ec5cae40d765fefbf4316c8073eaa
parent2dbb45d6dc0d20dc159b3d8e27ebb6825074827a (diff)
downloadgcc-0282c4acf720e4cc073cf95594aa890444c5ca82.zip
gcc-0282c4acf720e4cc073cf95594aa890444c5ca82.tar.gz
gcc-0282c4acf720e4cc073cf95594aa890444c5ca82.tar.bz2
rtl-optimization/106082 - preserve EH note for no non-local goto
The following makes sure we preserve EH notes on call insns that indicate the call doesn't perform a non-local goto when distributing notes after combining insns. 2022-06-28 Richard Biener <rguenther@suse.de> PR rtl-optimization/106082 * combine.cc (distribute_notes): Preserve notes when they indicate a call doesn't perform a non-local goto.
-rw-r--r--gcc/combine.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/combine.cc b/gcc/combine.cc
index a830527..a5fabf3 100644
--- a/gcc/combine.cc
+++ b/gcc/combine.cc
@@ -14218,8 +14218,10 @@ distribute_notes (rtx notes, rtx_insn *from_insn, rtx_insn *i3, rtx_insn *i2,
gcc_assert (from_insn == i3);
/* We are making sure there is a single effective REG_EH_REGION
note and it's valid to put it on i3. */
- if (!insn_could_throw_p (from_insn))
- /* Throw away stra notes on insns that can never throw. */
+ if (!insn_could_throw_p (from_insn)
+ && !(lp_nr == INT_MIN && can_nonlocal_goto (from_insn)))
+ /* Throw away stray notes on insns that can never throw or
+ make a nonlocal goto. */
;
else
{