@@ -4182,6 +4182,7 @@ vectorizable_store (gimple stmt, gimple_
dataref_ptr = unshare_expr (DR_BASE_ADDRESS (first_dr));
dataref_offset = build_int_cst (reference_alias_ptr_type
(DR_REF (first_dr)), 0);
+ inv_p = false;
}
else
dataref_ptr
@@ -5077,6 +5078,7 @@ vectorizable_load (gimple stmt, gimple_s
dataref_ptr = unshare_expr (DR_BASE_ADDRESS (first_dr));
dataref_offset = build_int_cst (reference_alias_ptr_type
(DR_REF (first_dr)), 0);
+ inv_p = false;
}
else
dataref_ptr
@@ -3460,6 +3460,9 @@ lower_rec_input_clauses (tree clauses, g
if (lane)
{
tree uid = create_tmp_var (ptr_type_node, "simduid");
+ /* Don't want uninit warnings on simduid, it is always uninitialized,
+ but we use it not for the value, but for the DECL_UID only. */
+ TREE_NO_WARNING (uid) = 1;
gimple g
= gimple_build_call_internal (IFN_GOMP_SIMD_LANE, 1, uid);
gimple_call_set_lhs (g, lane);
@@ -0,0 +1,16 @@
+/* PR tree-optimization/58472 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall -fopenmp" } */
+
+float a[1024], b[1024];
+
+float
+foo ()
+{
+ float s = 0.f;
+ unsigned int i;
+#pragma omp simd reduction(+:s)
+ for (i = 0; i < 1024; ++i)
+ s += a[i] * b[i];
+ return s;
+}