This skips invariant vector type setting for a scalar shift argument.
2020-05-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/95297
* tree-vect-stmts.c (vectorizable_shift): For scalar_shift_arg
skip updating operand 1 vector type.
* g++.dg/vect/pr95297.cc: New testcase.
* g++.dg/vect/pr95290.cc: Likewise.
+2020-05-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95297
+ * tree-vect-stmts.c (vectorizable_shift): For scalar_shift_arg
+ skip updating operand 1 vector type.
+
2020-05-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/95284
+2020-05-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95297
+ * g++.dg/vect/pr95297.cc: New testcase.
+ * g++.dg/vect/pr95290.cc: Likewise.
+
2020-05-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/95284
--- /dev/null
+// { dg-do compile }
+
+typedef short a;
+enum b {};
+typedef struct {
+ a c;
+} d;
+typedef struct {
+ a e, f;
+} g;
+typedef struct {
+ g h;
+} i;
+typedef struct {
+ d j;
+ int k;
+} l;
+class m
+{
+ i imgdata;
+ void n();
+ l o;
+};
+void m::n() try { imgdata.h.e = imgdata.h.f = o.j.c >> o.j.c; } catch (b) {
+}
--- /dev/null
+// { dg-do compile }
+// { dg-additional-options "-O3 -fvect-cost-model=dynamic" }
+
+extern bool var_10;
+extern int var_16;
+extern short var_17;
+extern long var_18;
+extern int arr_3[][13];
+
+int min(const int &a, const int &b)
+{
+ return a < b ? a : b;
+}
+
+void test() {
+ for (short a = 0; a < 010; a++)
+ for (char b = 0; b < 012; b++)
+ arr_3[a][b] = min(-var_10, 0) + 2147483647 >> var_10;
+ var_16 = (bool)4;
+ var_17 = 0;
+ var_18 = -1594153176;
+}
{
if (slp_node
&& (!vect_maybe_update_slp_op_vectype (slp_op0, vectype)
- || !vect_maybe_update_slp_op_vectype (slp_op1, op1_vectype)))
+ || (!scalar_shift_arg
+ && !vect_maybe_update_slp_op_vectype (slp_op1, op1_vectype))))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,