+2013-08-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/58006
+ * tree-parloops.c (take_address_of): Don't ICE if get_name
+ returns NULL.
+ (eliminate_local_variables_stmt): Remove clobber stmts.
+
2013-08-18 Eric Botcazou <ebotcazou@adacore.com>
* cgraphunit.c (handle_alias_pairs): Reset the alias flag after the
+2013-08-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/58006
+ * g++.dg/opt/pr58006.C: New test.
+
2013-08-18 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/specs/linker_alias.ads: New test.
--- /dev/null
+// PR tree-optimization/58006
+// { dg-do compile }
+// { dg-require-effective-target pthread }
+// { dg-options "-Ofast -ftree-parallelize-loops=2" }
+
+extern "C" float sqrtf (float);
+
+struct S
+{
+ float i, j;
+ float foo () const { return sqrtf (i * i + j * j); }
+ S () : i (1), j (1) {}
+};
+
+void
+bar (int a, int b)
+{
+ int i;
+ float f;
+ for (i = a; i < b; i++)
+ f = S ().foo ();
+}
if (gsi == NULL)
return NULL;
addr = TREE_OPERAND (*var_p, 0);
- name = make_temp_ssa_name (TREE_TYPE (addr), NULL,
- get_name (TREE_OPERAND
- (TREE_OPERAND (*var_p, 0), 0)));
+ const char *obj_name
+ = get_name (TREE_OPERAND (TREE_OPERAND (*var_p, 0), 0));
+ if (obj_name)
+ name = make_temp_ssa_name (TREE_TYPE (addr), NULL, obj_name);
+ else
+ name = make_ssa_name (TREE_TYPE (addr), NULL);
stmt = gimple_build_assign (name, addr);
gsi_insert_on_edge_immediate (entry, stmt);
dta.changed = true;
}
}
+ else if (gimple_clobber_p (stmt))
+ {
+ stmt = gimple_build_nop ();
+ gsi_replace (gsi, stmt, false);
+ dta.changed = true;
+ }
else
{
dta.gsi = gsi;