]> git.ipfire.org Git - thirdparty/gcc.git/commit
crc: Fix up ICE from optimize_crc_loop [PR120677]
authorJakub Jelinek <jakub@redhat.com>
Tue, 17 Jun 2025 11:20:11 +0000 (13:20 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 17 Jun 2025 11:20:11 +0000 (13:20 +0200)
commit75ffef5c6fa4e6e9576285e0403c06728309ae3e
tree87447108dfd792cde216207e3ffeb2b319d48289
parenta63b97e918b8592d0f6af94c5355efc82a49e06d
crc: Fix up ICE from optimize_crc_loop [PR120677]

The following testcase ICEs, because optimize_crc_loop inserts a call
statement before labels instead of after labels.

Fixed thusly (plus fixed other issues noticed around it).

2025-06-17  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/120677
* gimple-crc-optimization.cc (crc_optimization::optimize_crc_loop):
Insert before gsi_after_labels instead of gsi_start_bb.  Use
gimple_bb (output_crc) instead of output_crc->bb.  Formatting fix.

* gcc.c-torture/execute/pr120677.c: New test.
gcc/gimple-crc-optimization.cc
gcc/testsuite/gcc.c-torture/execute/pr120677.c [new file with mode: 0644]