aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-11-15 09:49:31 +0100
committerRichard Biener <rguenther@suse.de>2023-11-15 13:09:03 +0100
commitbcef48b59e4b4f86595929b490a8303da1239ac0 (patch)
tree58aa9ab94ba057ab6e9e9329d980f2f76f680503 /gcc
parentb648bc5c6e3d97f356c4e573e323787cc424ba78 (diff)
downloadgcc-bcef48b59e4b4f86595929b490a8303da1239ac0.zip
gcc-bcef48b59e4b4f86595929b490a8303da1239ac0.tar.gz
gcc-bcef48b59e4b4f86595929b490a8303da1239ac0.tar.bz2
Fix ICE with SLP and -fdbg-cnt
We have to clear the visited flag on stmts. * tree-vect-slp.cc (vect_slp_region): Also clear visited flag when we skipped an instance due to -fdbg-cnt.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-slp.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 80e279d..33c4d13 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -7652,6 +7652,7 @@ vect_slp_region (vec<basic_block> bbs, vec<data_reference_p> datarefs,
bb_vinfo->shared->check_datarefs ();
+ bool force_clear = false;
auto_vec<slp_instance> profitable_subgraphs;
for (slp_instance instance : BB_VINFO_SLP_INSTANCES (bb_vinfo))
{
@@ -7674,15 +7675,17 @@ vect_slp_region (vec<basic_block> bbs, vec<data_reference_p> datarefs,
vect_location = saved_vect_location;
if (!dbg_cnt (vect_slp))
- continue;
+ {
+ force_clear = true;
+ continue;
+ }
profitable_subgraphs.safe_push (instance);
}
/* When we're vectorizing an if-converted loop body make sure
we vectorized all if-converted code. */
- if (!profitable_subgraphs.is_empty ()
- && orig_loop)
+ if ((!profitable_subgraphs.is_empty () || force_clear) && orig_loop)
{
gcc_assert (bb_vinfo->bbs.length () == 1);
for (gimple_stmt_iterator gsi = gsi_start_bb (bb_vinfo->bbs[0]);