From: Jan Hubicka Date: Sat, 10 Oct 2020 20:16:59 +0000 (+0200) Subject: Fix ICE in remap_arguments with removed parameters. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=988f0466e80a6e4cc758f4df387b6c021b1cb078;p=gcc.git Fix ICE in remap_arguments with removed parameters. * ipa-modref.c (remap_arguments): Check range in map access. --- diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c index 4330b9ec10e..0fbb943e57c 100644 --- a/gcc/ipa-modref.c +++ b/gcc/ipa-modref.c @@ -1333,7 +1333,12 @@ remap_arguments (vec *map, modref_records *tt) modref_access_node *access_node; FOR_EACH_VEC_SAFE_ELT (ref_node->accesses, k, access_node) if (access_node->parm_index > 0) - access_node->parm_index = (*map)[access_node->parm_index]; + { + if (access_node->parm_index < (int)map->length ()) + access_node->parm_index = (*map)[access_node->parm_index]; + else + access_node->parm_index = -1; + } } } }