re PR tree-optimization/52115 (ICE: verify_ssa failed (missing definition for SSA_NAME))

2012-02-06  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/52115
	* tree-sra.c (access_has_replacements_p): New function.
	(sra_modify_assign): Use it to decide whether a use is uninitialized.

	* gcc.c-torture/compile/pr52115.c: New testcase.

From-SVN: r183937
This commit is contained in:
Richard Guenther 2012-02-06 14:54:47 +00:00 committed by Richard Biener
parent fe924d9ff0
commit 973a39ae60
4 changed files with 53 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2012-02-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52115
* tree-sra.c (access_has_replacements_p): New function.
(sra_modify_assign): Use it to decide whether a use is uninitialized.
2012-02-06 Patrick Marlier <patrick.marlier@gmail.com>
PR middle-end/52047

View File

@ -1,3 +1,8 @@
2012-02-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52115
* gcc.c-torture/compile/pr52115.c: New testcase.
2012-02-06 Jakub Jelinek <jakub@redhat.com>
PR target/52129

View File

@ -0,0 +1,26 @@
struct S
{
float f;
long l;
};
extern int gi;
extern float gf;
long foo (long p)
{
struct S s;
float *pf;
s.l = p;
pf = &s.f;
pf++;
pf--;
gf = *pf + 3.3;
gi = *((short *)pf) + 2;
return s.l + 6;
}

View File

@ -440,6 +440,20 @@ access_has_children_p (struct access *acc)
return acc && acc->first_child;
}
/* Return true iff ACC is (partly) covered by at least one replacement. */
static bool
access_has_replacements_p (struct access *acc)
{
struct access *child;
if (acc->grp_to_be_replaced)
return true;
for (child = acc->first_child; child; child = child->next_sibling)
if (access_has_replacements_p (child))
return true;
return false;
}
/* Return a vector of pointers to accesses for the variable given in BASE or
NULL if there is none. */
@ -2992,10 +3006,9 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi)
sra_stats.exprs++;
}
else if (racc
&& !access_has_children_p (racc)
&& !racc->grp_to_be_replaced
&& !racc->grp_unscalarized_data
&& TREE_CODE (lhs) == SSA_NAME)
&& TREE_CODE (lhs) == SSA_NAME
&& !access_has_replacements_p (racc))
{
rhs = get_repl_default_def_ssa_name (racc);
modify_this_stmt = true;