aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-09-12 19:28:19 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-09-12 19:28:19 -0700
commit84cce55d0e1acc39d7b5bb44403eb0e1e61fc7b6 (patch)
treeefa4c7cf22e184883607e95aae594bdc7e8b1fa1
parent40b7c2f8d2a28381db12d703dc628fda304a1b89 (diff)
downloadgcc-84cce55d0e1acc39d7b5bb44403eb0e1e61fc7b6.zip
gcc-84cce55d0e1acc39d7b5bb44403eb0e1e61fc7b6.tar.gz
gcc-84cce55d0e1acc39d7b5bb44403eb0e1e61fc7b6.tar.bz2
re PR tree-optimization/10528 (Unexpected loop un-optimization when removing a field of a class)
PR tree-opt/10528 * tree-inline.c (copy_body_r): Recompute bits for ADDR_EXPR, after copying its argument. From-SVN: r87423
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-inline.c10
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5a704a1..ce26d86 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-13 Richard Henderson <rth@redhat.com>
+
+ PR tree-opt/10528
+ * tree-inline.c (copy_body_r): Recompute bits for ADDR_EXPR,
+ after copying its argument.
+
2004-09-13 Joseph S. Myers <jsm@polyomino.org.uk>
* c-common.c, c-decl.c, c-lex.c, c-objc-common.c, c-opts.c,
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 6286f8a..82b7857 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -619,6 +619,16 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
TREE_OPERAND (*tp, 1) = TREE_OPERAND (*tp, 3);
TREE_OPERAND (*tp, 3) = NULL_TREE;
}
+
+ /* Variable substitution need not be simple. In particular, the
+ INDIRECT_REF substitution above. Make sure that TREE_CONSTANT
+ and friends are up-to-date. */
+ else if (TREE_CODE (*tp) == ADDR_EXPR)
+ {
+ walk_tree (&TREE_OPERAND (*tp, 0), copy_body_r, id, NULL);
+ recompute_tree_invarant_for_addr_expr (*tp);
+ *walk_subtrees = 0;
+ }
}
/* Keep iterating. */