aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-01-31 09:46:29 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-01-31 09:46:29 +0000
commit63d7ceaaba06f2b35d82e1e62fc9b8f2fe474857 (patch)
tree5ea0c479621776b2adb1ff8b939a8a4d8d9a54de /gcc/tree-sra.c
parent68c8a82477988ada951229f60840a7c01fa8b009 (diff)
downloadgcc-63d7ceaaba06f2b35d82e1e62fc9b8f2fe474857.zip
gcc-63d7ceaaba06f2b35d82e1e62fc9b8f2fe474857.tar.gz
gcc-63d7ceaaba06f2b35d82e1e62fc9b8f2fe474857.tar.bz2
re PR tree-optimization/51528 (SRA should not create BOOLEAN_TYPE replacements)
2012-01-31 Richard Guenther <rguenther@suse.de> PR tree-optimization/51528 * tree-sra.c (sra_modify_assign): Avoid copy-in/out for aggregate assigns. * gcc.dg/torture/pr51528.c: New testcase. From-SVN: r183752
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index ef26894..e3bf382 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -3135,9 +3135,14 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi)
sra_stats.deleted++;
return SRA_AM_REMOVED;
}
+ /* Restore the aggregate RHS from its components so the
+ prevailing aggregate copy does the right thing. */
if (access_has_children_p (racc))
- generate_subtree_copies (racc->first_child, lhs, racc->offset,
- 0, 0, gsi, false, true, loc);
+ generate_subtree_copies (racc->first_child, racc->base, 0, 0, 0,
+ gsi, false, false, loc);
+ /* Re-load the components of the aggregate copy destination.
+ But use the RHS aggregate to load from to expose more
+ optimization opportunities. */
if (access_has_children_p (lacc))
generate_subtree_copies (lacc->first_child, rhs, lacc->offset,
0, 0, gsi, true, true, loc);