Commit 1bbd3bde by Richard Guenther Committed by Richard Biener

re PR tree-optimization/46177 (ICE: in prop_phis, at…

re PR tree-optimization/46177 (ICE: in prop_phis, at tree-loop-distribution.c:327 with -fno-tree-copy-prop -ftree-loop-distribution)

2010-11-02  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/46177
	* tree-loop-distribution.c (prop_phis): Use
	mark_virtual_phi_result_for_renaming.

	* gcc.dg/pr46177.c: New testcase.

From-SVN: r166193
parent 4c203066
2010-11-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46177
* tree-loop-distribution.c (prop_phis): Use
mark_virtual_phi_result_for_renaming.
2010-11-02 Martin Jambor <mjambor@suse.cz> 2010-11-02 Martin Jambor <mjambor@suse.cz>
PR middle-end/46120 PR middle-end/46120
2010-11-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46177
* gcc.dg/pr46177.c: New testcase.
2010-11-02 Martin Jambor <mjambor@suse.cz> 2010-11-02 Martin Jambor <mjambor@suse.cz>
PR middle-end/46120 PR middle-end/46120
......
/* { dg-do compile } */
/* { dg-options "-O -fno-tree-copy-prop -ftree-loop-distribution" } */
extern int A[];
extern int B[];
void
foo (int j, int c)
{
int i;
if (c)
for (i = 0; i < j; i++)
A[i] = B[i] = 0;
for (i = 0; i < j; i++)
A[i] = B[i];
}
...@@ -317,27 +317,20 @@ static void ...@@ -317,27 +317,20 @@ static void
prop_phis (basic_block b) prop_phis (basic_block b)
{ {
gimple_stmt_iterator psi; gimple_stmt_iterator psi;
gimple_seq phis = phi_nodes (b);
for (psi = gsi_start (phis); !gsi_end_p (psi); ) for (psi = gsi_start_phis (b); !gsi_end_p (psi); )
{ {
gimple phi = gsi_stmt (psi); gimple phi = gsi_stmt (psi);
tree def = gimple_phi_result (phi), use = gimple_phi_arg_def (phi, 0); tree def = gimple_phi_result (phi);
gcc_assert (gimple_phi_num_args (phi) == 1);
if (!is_gimple_reg (def)) if (!is_gimple_reg (def))
{ mark_virtual_phi_result_for_renaming (phi);
imm_use_iterator iter;
use_operand_p use_p;
gimple stmt;
FOR_EACH_IMM_USE_STMT (stmt, iter, def)
FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
SET_USE (use_p, use);
}
else else
{
tree use = gimple_phi_arg_def (phi, 0);
gcc_assert (gimple_phi_num_args (phi) == 1);
replace_uses_by (def, use); replace_uses_by (def, use);
}
remove_phi_node (&psi, true); remove_phi_node (&psi, true);
} }
......
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