Commit 29b89442 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/58006 (ICE compiling VegaStrike with -ffast-math…

re PR tree-optimization/58006 (ICE compiling VegaStrike with -ffast-math -ftree-parallelize-loops=2)

	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.

	* g++.dg/opt/pr58006.C: New test.

From-SVN: r201827
parent 4f219961
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.
......
// 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 ();
}
......@@ -494,9 +494,12 @@ take_address_of (tree obj, tree type, edge entry,
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);
......@@ -694,6 +697,12 @@ eliminate_local_variables_stmt (edge entry, gimple_stmt_iterator *gsi,
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment