summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 4d505b7f1ad..2f3b21e8e8b 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -3190,6 +3190,10 @@ substitute_in_expr (tree exp, tree f, tree r)
}
TREE_READONLY (new_tree) |= TREE_READONLY (exp);
+
+ if (code == INDIRECT_REF || code == ARRAY_REF || code == ARRAY_RANGE_REF)
+ TREE_THIS_NOTRAP (new_tree) |= TREE_THIS_NOTRAP (exp);
+
return new_tree;
}
@@ -3357,6 +3361,10 @@ substitute_placeholder_in_expr (tree exp, tree obj)
}
TREE_READONLY (new_tree) |= TREE_READONLY (exp);
+
+ if (code == INDIRECT_REF || code == ARRAY_REF || code == ARRAY_RANGE_REF)
+ TREE_THIS_NOTRAP (new_tree) |= TREE_THIS_NOTRAP (exp);
+
return new_tree;
}