aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-12-12 16:44:23 +0000
committerJakub Jelinek <jakub@redhat.com>2011-12-12 16:44:23 +0000
commitf4884d3f6472b0f9ea493c262d3afd10ba6bab86 (patch)
tree9bceeac18d32564901706deccb1db4031d379b82 /gcc/calls.c
parent6a09d4e3ddb442df63d968a1716dcd575419490a (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@182246 138bc75d-0d04-0410-961f-82ee72b054a4
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);
}