https://gcc.gnu.org/g:40b9a7beb79acbea569be3066768cfb62c0f7c31

commit r15-2885-g40b9a7beb79acbea569be3066768cfb62c0f7c31
Author: Joern Rennecke <joern.renne...@riscy-ip.com>
Date:   Mon Aug 12 11:04:51 2024 +0100

    Avoid cfg corruption when using sjlj exceptions where loops are present in 
the assign_params emitted code.
    
    2024-08-06  Joern Rennecke  <joern.renne...@riscy-ip.com>
    
    gcc/
            * except.cc (sjlj_emit_function_enter):
            Set fn_begin_outside_block again if encountering a jump instruction.

Diff:
---
 gcc/except.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/except.cc b/gcc/except.cc
index b5886e97be9c..5bb5edbd8065 100644
--- a/gcc/except.cc
+++ b/gcc/except.cc
@@ -1228,6 +1228,10 @@ sjlj_emit_function_enter (rtx_code_label *dispatch_label)
        else if (NOTE_INSN_BASIC_BLOCK_P (fn_begin))
          fn_begin_outside_block = false;
       }
+    /* assign_params can indirectly call emit_block_move_via_loop, e.g.
+       for g++.dg/torture/pr85627.C for 16-bit targets.  */
+    else if (JUMP_P (fn_begin))
+      fn_begin_outside_block = true;
 
 #ifdef DONT_USE_BUILTIN_SETJMP
   if (dispatch_label)

Reply via email to