aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-11-06 08:34:16 +0100
committerRichard Biener <rguenther@suse.de>2020-11-06 08:34:16 +0100
commit2210bf6dec4a9868c828af546890805cac353f84 (patch)
tree50f12e1adaaab0449f89bdfd063569098bcda14d /gcc
parentc283a711c850efaab4fe3bca5ef7200eb854bba1 (diff)
downloadgcc-2210bf6dec4a9868c828af546890805cac353f84.zip
gcc-2210bf6dec4a9868c828af546890805cac353f84.tar.gz
gcc-2210bf6dec4a9868c828af546890805cac353f84.tar.bz2
tree-optimization/97733 - fix SLP of reductions with zero relevant
This adds a missing check. 2020-11-06 Richard Biener <rguenther@suse.de> PR tree-optimization/97733 * tree-vect-slp.c (vect_analyze_slp_instance): If less than two reductions were relevant or live do nothing.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-slp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 9c63983..4d1f17b 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -2539,6 +2539,9 @@ vect_analyze_slp_instance (vec_info *vinfo,
if (STMT_VINFO_RELEVANT_P (next_info)
|| STMT_VINFO_LIVE_P (next_info))
scalar_stmts.quick_push (next_info);
+ /* If less than two were relevant/live there's nothing to SLP. */
+ if (scalar_stmts.length () < 2)
+ return false;
}
/* Build the tree for the SLP instance. */