aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 073c1c7..d52e0c6 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1266,7 +1266,12 @@ copy_tree_body_r (tree *tp, int *walk_subtrees, void *data)
/* Handle the case where we substituted an INDIRECT_REF
into the operand of the ADDR_EXPR. */
if (TREE_CODE (TREE_OPERAND (*tp, 0)) == INDIRECT_REF)
- *tp = TREE_OPERAND (TREE_OPERAND (*tp, 0), 0);
+ {
+ tree t = TREE_OPERAND (TREE_OPERAND (*tp, 0), 0);
+ if (TREE_TYPE (t) != TREE_TYPE (*tp))
+ t = fold_convert (remap_type (TREE_TYPE (*tp), id), t);
+ *tp = t;
+ }
else
recompute_tree_invariant_for_addr_expr (*tp);