]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rtl-optimization/106082 - preserve EH note for no non-local goto
authorRichard Biener <rguenther@suse.de>
Tue, 28 Jun 2022 11:08:33 +0000 (13:08 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 29 Jun 2022 09:14:34 +0000 (11:14 +0200)
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.

gcc/combine.cc

index a8305273e4447fa202c2d4d912682d79e6131671..a5fabf397f75649100c3d7bd846a966c516a4fe0 100644 (file)
@@ -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
              {