From 30d2e94365655dae5bccb24797f97f5260da3154 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Fri, 27 May 2005 17:23:30 +0000 Subject: [multiple changes] 2005-05-18 Richard Guenther * tree-inline.c (copy_body_r): Manually fold *& to deal with ADDR_EXPRs with mismatched types for now. 2005-05-17 Richard Guenther * 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 * 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 --- gcc/tree-inline.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'gcc/tree-inline.c') 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; } -- cgit v1.1