aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-06-28 13:29:21 +0200
committerRichard Biener <rguenth@gcc.gnu.org>2024-06-28 14:50:14 +0200
commitff6e8b7f09712bd7ddfcd2830b286421f23abef9 (patch)
treebe1a2a15543d0fb7581da50a5e74b70e45c38451
parentc4b7b62bfa10816c1e08f0f9597d857f11379688 (diff)
downloadgcc-ff6e8b7f09712bd7ddfcd2830b286421f23abef9.zip
gcc-ff6e8b7f09712bd7ddfcd2830b286421f23abef9.tar.gz
gcc-ff6e8b7f09712bd7ddfcd2830b286421f23abef9.tar.bz2
tree-optimization/115652 - more fixing of the fix
The following addresses the corner case of an outer loop with an empty header where we end up asking for the BB of a NULL stmt by special-casing this case. PR tree-optimization/115652 * tree-vect-slp.cc (vect_schedule_slp_node): Handle the case where the outer loop header block is empty.
-rw-r--r--gcc/tree-vect-slp.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 174b480..dd9017e 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -9750,8 +9750,15 @@ vect_schedule_slp_node (vec_info *vinfo,
{
gimple_stmt_iterator si2
= gsi_after_labels (LOOP_VINFO_LOOP (loop_vinfo)->header);
- if (last_stmt != *si2
- && vect_stmt_dominates_stmt_p (last_stmt, *si2))
+ if ((gsi_end_p (si2)
+ && (LOOP_VINFO_LOOP (loop_vinfo)->header
+ != gimple_bb (last_stmt))
+ && dominated_by_p (CDI_DOMINATORS,
+ LOOP_VINFO_LOOP (loop_vinfo)->header,
+ gimple_bb (last_stmt)))
+ || (!gsi_end_p (si2)
+ && last_stmt != *si2
+ && vect_stmt_dominates_stmt_p (last_stmt, *si2)))
si = si2;
}
}