aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-04-07 14:34:35 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-04-07 14:34:35 +0000
commit95d938ee6f8d45d9e51c05bea7cb1b7dd695bbf4 (patch)
tree5dd1d68acb00270b58f4f8908dea2a0e27fc2236 /gcc
parent1a299ae4f206c4fd30ac72482c6685acd36ed9ab (diff)
downloadgcc-95d938ee6f8d45d9e51c05bea7cb1b7dd695bbf4.zip
gcc-95d938ee6f8d45d9e51c05bea7cb1b7dd695bbf4.tar.gz
gcc-95d938ee6f8d45d9e51c05bea7cb1b7dd695bbf4.tar.bz2
tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate constants everywhere.
2010-04-07 Richard Guenther <rguenther@suse.de> * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate constants everywhere. From-SVN: r158063
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-ssa-forwprop.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0840425..20aa611 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-07 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-forwprop.c (forward_propagate_addr_expr):
+ Propagate constants everywhere.
+
2010-04-07 Jakub Jelinek <jakub@redhat.com>
PR debug/43516
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 2151795..d7d378b 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -955,9 +955,10 @@ forward_propagate_addr_expr (tree name, tree rhs)
}
/* If the use is in a deeper loop nest, then we do not want
- to propagate the ADDR_EXPR into the loop as that is likely
- adding expression evaluations into the loop. */
- if (gimple_bb (use_stmt)->loop_depth > stmt_loop_depth)
+ to propagate non-invariant ADDR_EXPRs into the loop as that
+ is likely adding expression evaluations into the loop. */
+ if (gimple_bb (use_stmt)->loop_depth > stmt_loop_depth
+ && !is_gimple_min_invariant (rhs))
{
all = false;
continue;