diff options
author | Richard Guenther <rguenther@suse.de> | 2012-02-06 14:54:47 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-02-06 14:54:47 +0000 |
commit | 973a39ae60e4589489891b88b49fb15f4fa7c5d0 (patch) | |
tree | 9c8b602a7561843e42fb61606d5daa0659ca8d88 /gcc/tree-sra.c | |
parent | fe924d9ff03ae0e13ab26745c0020cc1fdaf9577 (diff) | |
download | gcc-973a39ae60e4589489891b88b49fb15f4fa7c5d0.zip gcc-973a39ae60e4589489891b88b49fb15f4fa7c5d0.tar.gz gcc-973a39ae60e4589489891b88b49fb15f4fa7c5d0.tar.bz2 |
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
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r-- | gcc/tree-sra.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index e3bf382..e2091e5 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -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; |