aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenth@gcc.gnu.org>2005-05-27 17:23:30 +0000
committerJeff Law <law@gcc.gnu.org>2005-05-27 11:23:30 -0600
commit30d2e94365655dae5bccb24797f97f5260da3154 (patch)
tree62ea9650b917f6874d18e3dfbb1662d57f77d04b /gcc/tree-inline.c
parent46aad78f22f0d84855daed56e7369e73e31c8c26 (diff)
downloadgcc-30d2e94365655dae5bccb24797f97f5260da3154.zip
gcc-30d2e94365655dae5bccb24797f97f5260da3154.tar.gz
gcc-30d2e94365655dae5bccb24797f97f5260da3154.tar.bz2
[multiple changes]
2005-05-18 Richard Guenther <rguenth@gcc.gnu.org> * tree-inline.c (copy_body_r): Manually fold *& to deal with ADDR_EXPRs with mismatched types for now. 2005-05-17 Richard Guenther <rguenth@gcc.gnu.org> * gimplify.c (fold_indirect_ref_rhs): New function. (gimplify_modify_expr_rhs): Use it instead of pessimistic fold_indirect_ref. 2005-05-15 Richard Guenther <rguenth@gcc.gnu.org> * fold-const.c (fold_indirect_ref_1): Add type argument; make sure the resulting expression is of this type. (build_fold_indirect_ref, fold_indirect_ref): Adjust callers. From-SVN: r100267
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 118f493..c04fe33 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -613,7 +613,17 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
n = splay_tree_lookup (id->decl_map, (splay_tree_key) decl);
if (n)
{
- *tp = build_fold_indirect_ref ((tree)n->value);
+ /* If we happen to get an ADDR_EXPR in n->value, strip
+ it manually here as we'll eventually get ADDR_EXPRs
+ which lie about their types pointed to. In this case
+ build_fold_indirect_ref wouldn't strip the INDIRECT_REF,
+ but we absolutely rely on that. */
+ if (TREE_CODE ((tree)n->value) == ADDR_EXPR)
+ *tp = TREE_OPERAND ((tree)n->value, 0);
+ else
+ *tp = build1 (INDIRECT_REF,
+ TREE_TYPE (TREE_TYPE ((tree)n->value)),
+ (tree)n->value);
*walk_subtrees = 0;
return NULL;
}