I forgot to guard the promotion to external for the case where the
def is in a pattern.
2020-10-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/97496
* tree-vect-slp.c (vect_get_and_check_slp_defs): Guard extern
promotion with not in pattern.
* gcc.dg/vect/bb-slp-pr97496.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+
+int a;
+int b[1024];
+void c(unsigned g) {
+ if (a) {
+ long e = g, d = e;
+ int f = 0;
+ for (; f < 4; f++) {
+ b[f] = d;
+ d >>= 8;
+ }
+ }
+}
continue;
}
- if (is_a <bb_vec_info> (vinfo))
+ if (is_a <bb_vec_info> (vinfo)
+ && !oprnd_info->any_pattern)
{
/* Now for commutative ops we should see whether we can
make the other operand matching. */