aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 63dc673..0fe3afc 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -13426,7 +13426,9 @@ array_ref_low_bound (tree exp)
return SUBSTITUTE_PLACEHOLDER_IN_EXPR (TYPE_MIN_VALUE (domain_type), exp);
/* Otherwise, return a zero of the appropriate type. */
- return build_int_cst (TREE_TYPE (TREE_OPERAND (exp, 1)), 0);
+ tree idxtype = TREE_TYPE (TREE_OPERAND (exp, 1));
+ return (idxtype == error_mark_node
+ ? integer_zero_node : build_int_cst (idxtype, 0));
}
/* Return a tree representing the upper bound of the array mentioned in