https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87458

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
-  u._M_elems[0] = 7.0e+0;
-  u._M_elems[1] = 7.0e+0;
+  MEM[(double *)&u] = { 7.0e+0, 7.0e+0 };
   D.41349 = create (1.0e+2);
-  _9 = MEM[(value_type &)&u];
-  tmp_10 = -_9;
   _11 = MEM[(const value_type &)&D.41349];
-  _12 = _11 * 1.0e+0 + tmp_10;
-  MEM[(value_type &)&u] = _12;
-  _13 = MEM[(value_type &)&u + 8];
-  tmp_14 = -_13;
+  vect__11.38_25 = MEM[(const value_type &)&D.41349];
   _15 = MEM[(const value_type &)&D.41349 + 8];
-  _16 = _15 * 1.0e+0 + tmp_14;
-  MEM[(value_type &)&u + 8] = _16;
+  vect_cst__29 = {_11, _15};
+  vect__12.43_30 = vect__11.38_25 * { 1.0e+0, 1.0e+0 } + vect_cst__29;
+  MEM[(value_type &)&u] = vect__12.43_30;

It is worse, notice how _11 * 1.0e+0 + tmp_10; and _15 * 1.0e+0 + tmp_14; are
combined into:
vect_cst__29 = {_11, _15};
vect__11.38_25 * { 1.0e+0, 1.0e+0 } + vect_cst__29;
But vect_cst__29 is not {tmp_10, tmp_14} or -{_9, _13} or rather
-MEM[(value_type &)&u];

Looks like the SLP vectorizer is using operand 0 for the operand 2 which is
incorrect.

Reply via email to