]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR rtl-optimization/106421: ICE in bypass_block from non-local goto.
authorRoger Sayle <roger@nextmovesoftware.com>
Tue, 10 Jan 2023 14:05:46 +0000 (14:05 +0000)
committerRichard Biener <rguenther@suse.de>
Thu, 27 Apr 2023 11:57:48 +0000 (13:57 +0200)
commit0a5fb0ee337b824224a2c13b76fd682b62e6d314
treec837e621b11d9a1a99cbf83fa211705ff17a36d6
parent37da428922e5cb548430aa00482d6a4c7aa8f8b2
PR rtl-optimization/106421: ICE in bypass_block from non-local goto.

This patch fixes PR rtl-optimization/106421, an ICE-on-valid (but
undefined) regression.  The fix, as proposed by Richard Biener, is to
defend against BLOCK_FOR_INSN returning NULL in cprop's bypass_block.

2023-01-10  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
PR rtl-optimization/106421
* cprop.cc (bypass_block): Check that DEST is local to this
function (non-NULL) before calling find_edge.

gcc/testsuite/ChangeLog
PR rtl-optimization/106421
* gcc.dg/pr106421.c: New test case.

(cherry picked from commit 851e1ba03f9de699a754dd8648fc151c3e26d697)
gcc/cprop.cc
gcc/testsuite/gcc.dg/pr106421.c [new file with mode: 0644]