diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 075b1a011bd..3f3a1bc3d7c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2013-09-17 Jan Hubicka + + PR middle-end/58329 + * ipa-devirt.c (ipa_devirt): Be ready for symtab_nonoverwritable_alias + to return NULL. + * ipa.c (function_and_variable_visibility): Likewise. + * ipa-profile.c (ipa_profile): Likewise. + 2013-09-17 Bernd Edlinger PR ipa/58398 diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index 1be19f89d05..85bc5b0652b 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -1098,7 +1098,13 @@ ipa_devirt (void) cgraph_node_name (likely_target), likely_target->symbol.order); if (!symtab_can_be_discarded ((symtab_node) likely_target)) - likely_target = cgraph (symtab_nonoverwritable_alias ((symtab_node)likely_target)); + { + cgraph_node *alias; + alias = cgraph (symtab_nonoverwritable_alias + ((symtab_node)likely_target)); + if (alias) + likely_target = alias; + } nconverted++; update = true; cgraph_turn_edge_to_speculative diff --git a/gcc/ipa-profile.c b/gcc/ipa-profile.c index 2b22333d1b9..424e4a6b6fe 100644 --- a/gcc/ipa-profile.c +++ b/gcc/ipa-profile.c @@ -625,7 +625,13 @@ ipa_profile (void) of N2. Speculate on the local alias to allow inlining. */ if (!symtab_can_be_discarded ((symtab_node) n2)) - n2 = cgraph (symtab_nonoverwritable_alias ((symtab_node)n2)); + { + cgraph_node *alias; + alias = cgraph (symtab_nonoverwritable_alias + ((symtab_node)n2)); + if (alias) + n2 = alias; + } nconverted++; cgraph_turn_edge_to_speculative (e, n2, diff --git a/gcc/ipa.c b/gcc/ipa.c index 91d63eb9f85..67b3bc0f07c 100644 --- a/gcc/ipa.c +++ b/gcc/ipa.c @@ -998,7 +998,7 @@ function_and_variable_visibility (bool whole_program) { struct cgraph_node *alias = cgraph (symtab_nonoverwritable_alias ((symtab_node) node)); - if (alias != node) + if (alias && alias != node) { while (node->callers) {