From: Joern Rennecke Date: Mon, 12 Aug 2024 10:04:51 +0000 (+0100) Subject: Avoid cfg corruption when using sjlj exceptions where loops are present in the assign... X-Git-Tag: basepoints/gcc-16~6668 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40b9a7beb79acbea569be3066768cfb62c0f7c31;p=thirdparty%2Fgcc.git Avoid cfg corruption when using sjlj exceptions where loops are present in the assign_params emitted code. 2024-08-06 Joern Rennecke gcc/ * except.cc (sjlj_emit_function_enter): Set fn_begin_outside_block again if encountering a jump instruction. --- diff --git a/gcc/except.cc b/gcc/except.cc index b5886e97be9..5bb5edbd806 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)