]> gcc.gnu.org Git - gcc.git/commit
middle-end: fix ICE when destination BB for stores starts with a label [PR113750]
authorTamar Christina <tamar.christina@arm.com>
Wed, 7 Feb 2024 10:59:32 +0000 (10:59 +0000)
committerTamar Christina <tamar.christina@arm.com>
Wed, 7 Feb 2024 10:59:32 +0000 (10:59 +0000)
commit5c3ba60024fedc6b3d374ebb071bcf5b3e27cd62
treed9dcdbcbc188ad6b2fdfc0e54b2fb1c1c390e9d7
parent8f6ed71d8fff3c3c6249651a72aee084e31ffb9e
middle-end: fix ICE when destination BB for stores starts with a label [PR113750]

The report shows that if the FE leaves a label as the first thing in the dest
BB then we ICE because we move the stores before the label.

This is easy to fix if we know that there's still only one way into the BB.
We would have already rejected the loop if there was multiple paths into the BB
however I added an additional check just for early break in case the other
constraints are relaxed later with an explanation.

After that we fix the issue just by getting the GSI after the labels and I add
a bunch of testcases for different positions the label can be added.  Only the
vect-early-break_112-pr113750.c one results in the label being kept.

gcc/ChangeLog:

PR tree-optimization/113750
* tree-vect-data-refs.cc (vect_analyze_early_break_dependences): Check
for single predecessor when doing early break vect.
* tree-vect-loop.cc (move_early_exit_stmts): Get gsi at the start but
after labels.

gcc/testsuite/ChangeLog:

PR tree-optimization/113750
* gcc.dg/vect/vect-early-break_112-pr113750.c: New test.
* gcc.dg/vect/vect-early-break_113-pr113750.c: New test.
* gcc.dg/vect/vect-early-break_114-pr113750.c: New test.
* gcc.dg/vect/vect-early-break_115-pr113750.c: New test.
* gcc.dg/vect/vect-early-break_116-pr113750.c: New test.
gcc/testsuite/gcc.dg/vect/vect-early-break_112-pr113750.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-early-break_113-pr113750.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-early-break_114-pr113750.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-early-break_115-pr113750.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-early-break_116-pr113750.c [new file with mode: 0644]
gcc/tree-vect-data-refs.cc
gcc/tree-vect-loop.cc
This page took 0.073282 seconds and 5 git commands to generate.