Commit 973a39ae by Richard Guenther Committed by Richard Biener

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
parent fe924d9f
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> 2012-02-06 Patrick Marlier <patrick.marlier@gmail.com>
PR middle-end/52047 PR middle-end/52047
......
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> 2012-02-06 Jakub Jelinek <jakub@redhat.com>
PR target/52129 PR target/52129
......
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;
}
...@@ -440,6 +440,20 @@ access_has_children_p (struct access *acc) ...@@ -440,6 +440,20 @@ access_has_children_p (struct access *acc)
return acc && acc->first_child; 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 /* Return a vector of pointers to accesses for the variable given in BASE or
NULL if there is none. */ NULL if there is none. */
...@@ -2992,10 +3006,9 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi) ...@@ -2992,10 +3006,9 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi)
sra_stats.exprs++; sra_stats.exprs++;
} }
else if (racc else if (racc
&& !access_has_children_p (racc)
&& !racc->grp_to_be_replaced
&& !racc->grp_unscalarized_data && !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); rhs = get_repl_default_def_ssa_name (racc);
modify_this_stmt = true; modify_this_stmt = 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