re PR tree-optimization/55862 (ICE in compute_antic, at tree-ssa-pre.c:2495)

2013-01-04  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/55862
	* tree-ssa-pre.c (phi_translate_1): Valueize SSA names after
	translating them through PHI nodes.

	* gcc.dg/torture/pr55862.c: New testcase.

From-SVN: r194906
This commit is contained in:
Richard Biener 2013-01-04 13:28:53 +00:00 committed by Richard Biener
parent 87eab55418
commit 361618ec53
4 changed files with 46 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2013-01-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/55862
* tree-ssa-pre.c (phi_translate_1): Valueize SSA names after
translating them through PHI nodes.
2013-01-04 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/55755

View file

@ -1,3 +1,8 @@
2013-01-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/55862
* gcc.dg/torture/pr55862.c: New testcase.
2013-01-04 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/55755

View file

@ -0,0 +1,31 @@
/* { dg-do compile } */
int g, a, *b;
void f(void)
{
int *p;
if(g)
{
int **k = &p;
for(; g; p++)
for(a = 0; a < 1; a++)
{
int *c = p;
label2:
if(a < 1)
*c = 0;
}
goto label1;
while(g++)
for(*b = 0; *b; b++)
label1:
;
}
goto label2;
}

View file

@ -1729,6 +1729,10 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
edge e = find_edge (pred, gimple_bb (def_stmt));
tree def = PHI_ARG_DEF (def_stmt, e->dest_idx);
/* Valueize it. */
if (TREE_CODE (def) == SSA_NAME)
def = VN_INFO (def)->valnum;
/* Handle constant. */
if (is_gimple_min_invariant (def))
return get_or_alloc_expr_for_constant (def);