From: Richard Biener Date: Thu, 14 Jun 2018 10:55:00 +0000 (+0000) Subject: re PR ipa/86124 (ICE in create_variable_info_for, at tree-ssa-structalias.c:6123) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a16fa075a887aad84b4de0d6d396bec06d539e39;p=gcc.git re PR ipa/86124 (ICE in create_variable_info_for, at tree-ssa-structalias.c:6123) 2018-06-14 Richard Biener PR ipa/86124 * tree-ssa-struct-alias.c (create_variable_info_for): Handle NULL cgraph_node. * gcc.dg/pr86124.c: New testcase. From-SVN: r261587 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ceb0d665f68..bdd94933e1c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-06-14 Richard Biener + + PR ipa/86124 + * tree-ssa-struct-alias.c (create_variable_info_for): Handle + NULL cgraph_node. + 2018-06-14 Sebastian Huber * config/rtems.h (STDINT_LONG32): Define. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 32d158fbf43..1286073f51d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-06-14 Richard Biener + + PR ipa/86124 + * gcc.dg/pr86124.c: New testcase. + 2018-06-13 Martin Sebor PR tree-optimization/86114 diff --git a/gcc/testsuite/gcc.dg/pr86124.c b/gcc/testsuite/gcc.dg/pr86124.c new file mode 100644 index 00000000000..218b48295f7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr86124.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fipa-pta" } */ + +extern void a (void); + +void b (void) +{ + void *c; + c = a; + *(char *)c = 1; +} diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 73e500bb616..ac5d4bc93fe 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -6120,7 +6120,8 @@ create_variable_info_for (tree decl, const char *name, bool add_id) cgraph_node *node; if (in_ipa_mode && TREE_CODE (decl) == FUNCTION_DECL - && (node = cgraph_node::get (decl))->ifunc_resolver) + && (node = cgraph_node::get (decl)) + && node->ifunc_resolver) { varinfo_t fi = get_vi_for_tree (node->get_alias_target ()->decl); constraint_expr rhs