--- /dev/null
+// { dg-do run }
+// { dg-additional-options "-ffast-math" }
+
+double a1 = 1.0;
+double a2 = 1.0;
+
+void __attribute__((noipa))
+f(double K[2], bool b)
+{
+ double A[] = {
+ b ? a1 : a2,
+ 0,
+ 0,
+ 0
+ };
+
+ double sum{};
+ for(double a : A) sum += a;
+ for(double& a : A) a /= sum;
+
+ if (b) {
+ K[0] = A[0]; // 1.0
+ K[1] = A[1]; // 0.0
+ } else {
+ K[0] = A[0] + A[1];
+ }
+}
+
+int main()
+{
+ double K[2]{};
+ f(K, true);
+ if (K[0] != 1. || K[1] != 0.)
+ __builtin_abort ();
+}
{
/* Preserve the special VEC_PERM we use to shield existing
vector defs from the rest. But make it a no-op. */
+ auto_vec<stmt_vec_info, 64> saved;
+ saved.create (SLP_TREE_SCALAR_STMTS (old).length ());
+ for (unsigned i = 0;
+ i < SLP_TREE_SCALAR_STMTS (old).length (); ++i)
+ saved.quick_push (SLP_TREE_SCALAR_STMTS (old)[i]);
+ for (unsigned i = 0;
+ i < SLP_TREE_SCALAR_STMTS (old).length (); ++i)
+ SLP_TREE_SCALAR_STMTS (old)[i]
+ = saved[SLP_TREE_LANE_PERMUTATION (old)[i].second];
unsigned i = 0;
for (std::pair<unsigned, unsigned> &p
: SLP_TREE_LANE_PERMUTATION (old))