re PR ipa/86124 (ICE in create_variable_info_for, at tree-ssa-structalias.c:6123)
authorRichard Biener <rguenther@suse.de>
Thu, 14 Jun 2018 10:55:00 +0000 (10:55 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 14 Jun 2018 10:55:00 +0000 (10:55 +0000)
2018-06-14  Richard Biener  <rguenther@suse.de>

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr86124.c [new file with mode: 0644]
gcc/tree-ssa-structalias.c

index ceb0d665f6897b2e1697f47dab2f830ebcf77abd..bdd94933e1c82ead366904097db6e58ef3042b97 100644 (file)
@@ -1,3 +1,9 @@
+2018-06-14  Richard Biener  <rguenther@suse.de>
+
+       PR ipa/86124
+       * tree-ssa-struct-alias.c (create_variable_info_for): Handle
+       NULL cgraph_node.
+
 2018-06-14  Sebastian Huber  <sebastian.huber@embedded-brains.de>
 
        * config/rtems.h (STDINT_LONG32): Define.
index 32d158fbf436202cff9db3c8b290e8b0d87cac70..1286073f51de427428f660552fb8a492cf297c3b 100644 (file)
@@ -1,3 +1,8 @@
+2018-06-14  Richard Biener  <rguenther@suse.de>
+
+       PR ipa/86124
+       * gcc.dg/pr86124.c: New testcase.
+
 2018-06-13  Martin Sebor  <msebor@redhat.com>
 
        PR tree-optimization/86114
diff --git a/gcc/testsuite/gcc.dg/pr86124.c b/gcc/testsuite/gcc.dg/pr86124.c
new file mode 100644 (file)
index 0000000..218b482
--- /dev/null
@@ -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;
+}
index 73e500bb616ca7d9de7b9d316023ee37d6ddcc23..ac5d4bc93fe95a86917b37dbcaa637c1f8f215e4 100644 (file)
@@ -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