Commit c4f548b8 by Diego Novillo Committed by Diego Novillo

re PR tree-optimization/22037 (internal compiler error: verify_ssa failed)


	PR 22037
	* tree-cfg.c (replace_uses_by): Call mark_new_vars_to_rename.
	(tree_merge_blocks): Propagate anything allowed by
	may_propagate_copy.
	Clarify documentation.
	* passes.c (execute_todo): If cleanup_tree_cfg invalidated the
	SSA form, schedule an update if necessary.

testsuite/ChangeLog

	PR 22037
	* g++.dg/tree-ssa/pr22037.C:

From-SVN: r102740
parent 9ef524ba
2005-08-04 Diego Novillo <dnovillo@redhat.com>
PR 22037
* tree-cfg.c (replace_uses_by): Call mark_new_vars_to_rename.
(tree_merge_blocks): Propagate anything allowed by
may_propagate_copy.
Clarify documentation.
* passes.c (execute_todo): If cleanup_tree_cfg invalidated the
SSA form, schedule an update if necessary.
2005-08-04 Gerald Pfeifer <gerald@pfeifer.com>
* doc/install.texi (Binaries): Remove broken link to
......
......@@ -684,6 +684,15 @@ execute_todo (struct tree_opt_pass *pass, unsigned int flags, bool use_required)
cleanup_tree_cfg_loop ();
else
cleanup_tree_cfg ();
/* When cleanup_tree_cfg merges consecutive blocks, it may
perform some simplistic propagation when removing single
valued PHI nodes. This propagation may, in turn, cause the
SSA form to become out-of-date (see PR 22037). So, even
if the parent pass had not scheduled an SSA update, we may
still need to do one. */
if (!(flags & TODO_update_ssa_any) && need_ssa_update_p ())
flags |= TODO_update_ssa;
}
if (flags & TODO_update_ssa_any)
......
2005-08-04 Diego Novillo <dnovillo@redhat.com>
PR 22037
* g++.dg/tree-ssa/pr22037.C:
2005-08-04 Richard Henderson <rth@redhat.com>
* gcc.dg/tree-ssa/update-cunroll.c: Fix mistakes in
......
/* { dg-do compile } */
/* { dg-options "-O2" } */
extern double sqrt (double) throw ();
void foo(double& d, int n)
{
double e=0;
for(int i=0; i<n; i++);
for(int i=0; i<n; i++) e=1;
d = sqrt(e);
for(int i=0; i<n; i++);
}
......@@ -1273,7 +1273,7 @@ replace_uses_by (tree name, tree val)
if (TREE_CODE (rhs) == ADDR_EXPR)
recompute_tree_invarant_for_addr_expr (rhs);
update_stmt (stmt);
mark_new_vars_to_rename (stmt);
}
VEC_free (tree, heap, stmts);
......@@ -1304,18 +1304,15 @@ tree_merge_blocks (basic_block a, basic_block b)
if (dump_file)
fprintf (dump_file, "Merging blocks %d and %d\n", a->index, b->index);
/* Remove the phi nodes. */
/* Remove all single-valued PHI nodes from block B of the form
V_i = PHI <V_j> by propagating V_j to all the uses of V_i. */
bsi = bsi_last (a);
for (phi = phi_nodes (b); phi; phi = phi_nodes (b))
{
tree def = PHI_RESULT (phi), use = PHI_ARG_DEF (phi, 0);
tree copy;
if (!may_propagate_copy (def, use)
/* Propagating pointers might cause the set of vops for statements
to be changed, and thus require ssa form update. */
|| (is_gimple_reg (def)
&& POINTER_TYPE_P (TREE_TYPE (def))))
if (!may_propagate_copy (def, use))
{
gcc_assert (is_gimple_reg (def));
......@@ -1330,6 +1327,7 @@ tree_merge_blocks (basic_block a, basic_block b)
}
else
replace_uses_by (def, use);
remove_phi_node (phi, NULL);
}
......
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