Commit ca73a1f7 by Marc Glisse Committed by Marc Glisse

re PR tree-optimization/61385 (ICE on valid code at -O2 and -O3 on x86_64-linux-gnu)

2014-06-04  Marc Glisse  <marc.glisse@inria.fr>

	PR tree-optimization/61385
gcc/
	* tree-ssa-phiopt.c (value_replacement): Punt if there are PHI nodes.
gcc/testsuite/
	* gcc.dg/tree-ssa/pr61385.c: New file.

From-SVN: r211245
parent ffb1f5ef
2014-06-04 Marc Glisse <marc.glisse@inria.fr>
PR tree-optimization/61385
* tree-ssa-phiopt.c (value_replacement): Punt if there are PHI nodes.
2014-06-04 Bernd Schmidt <bernds@codesourcery.com> 2014-06-04 Bernd Schmidt <bernds@codesourcery.com>
* lto-wrapper.c (fatal, fatal_perror): Remove functions. All callers * lto-wrapper.c (fatal, fatal_perror): Remove functions. All callers
......
2014-06-04 Marc Glisse <marc.glisse@inria.fr>
PR tree-optimization/61385
* gcc.dg/tree-ssa/pr61385.c: New file.
2014-06-04 Richard Biener <rguenther@suse.de> 2014-06-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/60098 PR tree-optimization/60098
......
/* { dg-do compile } */
/* { dg-options "-O2" } */
#define assert(x) if (!(x)) __builtin_abort ()
int a, b, c, d, e, f, g;
int
fn1 ()
{
int *h = &c;
for (; c < 1; c++)
{
int *i = &a, *k = &a;
f = 0;
if (b)
return 0;
if (*h)
{
int **j = &i;
*j = 0;
d = 0;
}
else
g = e = 0;
if (*h)
{
int **l = &k;
*l = &g;
}
d &= *h;
assert (k == &a || k);
assert (i);
}
return 0;
}
int
main ()
{
fn1 ();
return 0;
}
...@@ -849,6 +849,10 @@ value_replacement (basic_block cond_bb, basic_block middle_bb, ...@@ -849,6 +849,10 @@ value_replacement (basic_block cond_bb, basic_block middle_bb,
&& !POINTER_TYPE_P (TREE_TYPE (arg0)))) && !POINTER_TYPE_P (TREE_TYPE (arg0))))
return 0; return 0;
/* Punt if there are (degenerate) PHIs in middle_bb, there should not be. */
if (!gimple_seq_empty_p (phi_nodes (middle_bb)))
return 0;
/* Only transform if it removes the condition. */ /* Only transform if it removes the condition. */
if (!single_non_singleton_phi_for_edges (phi_nodes (gimple_bb (phi)), e0, e1)) if (!single_non_singleton_phi_for_edges (phi_nodes (gimple_bb (phi)), e0, e1))
return 0; return 0;
......
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