summaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-12-12 17:44:23 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-12-12 17:44:23 +0100
commitc79be1dc34dd39f6a58aad45a92d39f7bb3a0534 (patch)
tree9bceeac18d32564901706deccb1db4031d379b82 /gcc/calls.c
parent431e1124edfc6ac99951af5286190d92c983354d (diff)
downloadgcc-c79be1dc34dd39f6a58aad45a92d39f7bb3a0534.tar.gz
re PR middle-end/51510 (gcc for arm-linux-gnueabi ICEs on gcc.c-torture/execute/20050713-1.c due to PR50074+PR51323 fix)
PR middle-end/51510 * calls.c (internal_arg_pointer_based_exp_scan): Don't use VEC_safe_grow_cleared if idx is smaller than VEC_length. From-SVN: r182246
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 95369b7baef..0ef0cad8d27 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1705,9 +1705,11 @@ internal_arg_pointer_based_exp_scan (void)
val = internal_arg_pointer_based_exp (SET_SRC (set), false);
if (val != NULL_RTX)
{
- VEC_safe_grow_cleared (rtx, heap,
- internal_arg_pointer_exp_state.cache,
- idx + 1);
+ if (idx
+ >= VEC_length (rtx, internal_arg_pointer_exp_state.cache))
+ VEC_safe_grow_cleared (rtx, heap,
+ internal_arg_pointer_exp_state.cache,
+ idx + 1);
VEC_replace (rtx, internal_arg_pointer_exp_state.cache,
idx, val);
}