I was mistaken to treat vect_external_def as only applying to
SSA_NAME defs, so check for that.
2020-11-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/97650
* tree-vect-slp.c (vect_get_and_check_slp_defs): Check
for SSA_NAME before checking SSA_NAME_IS_DEFAULT_DEF.
* gcc.dg/vect/bb-slp-pr97650.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-Os -fallow-store-data-races" } */
+
+short a=0;
+unsigned long *volatile *volatile *volatile *b;
+unsigned long *volatile *volatile *volatile **c[7];
+void d() {
+ short e=0;
+ for (; a;) {
+ e = 0;
+ for (; e < 7; e++)
+ c[e] = &b;
+ }
+}
+int main() { return 0; }
if (backedge
&& dts[i] == vect_external_def
&& is_a <bb_vec_info> (vinfo)
+ && TREE_CODE (oprnd) == SSA_NAME
&& !SSA_NAME_IS_DEFAULT_DEF (oprnd)
&& !dominated_by_p (CDI_DOMINATORS,
as_a <bb_vec_info> (vinfo)->bbs[0],