2010-06-21 Jakub Jelinek <jakub@redhat.com> * tree-ssa-structalias.c (set_uids_in_ptset): Change return type to bool. If get_subvar_at returns NULL, instead of segfaulting return false. (find_what_p_points_to): If set_uids_in_ptset failed, set pi->pt_anything, clear pi->pt_vars and return false. --- gcc/tree-ssa-structalias.c 2007-06-26 17:59:16.000000000 +0200 +++ gcc/tree-ssa-structalias.c 2010-06-21 11:13:58.290958431 +0200 @@ -3371,7 +3371,7 @@ intra_create_variable_infos (void) /* Set bits in INTO corresponding to the variable uids in solution set FROM */ -static void +static bool set_uids_in_ptset (bitmap into, bitmap from) { unsigned int i; @@ -3425,6 +3425,8 @@ set_uids_in_ptset (bitmap into, bitmap f /* If VI->DECL is an aggregate for which we created SFTs, add the SFT corresponding to VI->OFFSET. */ tree sft = get_subvar_at (vi->decl, vi->offset); + if (sft == NULL) + return false; bitmap_set_bit (into, DECL_UID (sft)); } else @@ -3434,6 +3436,7 @@ set_uids_in_ptset (bitmap into, bitmap f } } } + return true; } @@ -3507,7 +3510,12 @@ find_what_p_points_to (tree p) if (!pi->pt_vars) pi->pt_vars = BITMAP_GGC_ALLOC (); - set_uids_in_ptset (pi->pt_vars, vi->solution); + if (!set_uids_in_ptset (pi->pt_vars, vi->solution)) + { + pi->pt_anything = 1; + pi->pt_vars = NULL; + return false; + } if (bitmap_empty_p (pi->pt_vars)) pi->pt_vars = NULL;