]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR ipa/61921 (ICE: SIGSEGV in varpool_node::get_constructor(), at varpool.c:275...
authorRichard Biener <rguenther@suse.de>
Mon, 28 Jul 2014 08:25:34 +0000 (08:25 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 28 Jul 2014 08:25:34 +0000 (08:25 +0000)
2014-07-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/61921
* tree-ssa-structalias.c (create_variable_info_for_1): Check
if there is a varpool node before dereferencing it.

* gfortran.dg/pr61921.f90: New testcase.

From-SVN: r213114

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

index 5476b599865e0422a50a9a6dc725eab59511176b..740971a5eeec3d890929ad1184806fad1a1643ab 100644 (file)
@@ -1,3 +1,9 @@
+2014-07-28  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/61921
+       * tree-ssa-structalias.c (create_variable_info_for_1): Check
+       if there is a varpool node before dereferencing it.
+
 2014-07-28  Roman Gareev  <gareevroman@gmail.com>
 
        * graphite-sese-to-poly.c:
index 581aedf236e0c98fd2952a87033937813cd50d5c..68499d9eed0f14302b6ce72d2e48899686f4a7e1 100644 (file)
@@ -1,3 +1,8 @@
+2014-07-28  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/61921
+       * gfortran.dg/pr61921.f90: New testcase.
+
 2014-07-28  Richard Biener  <rguenther@suse.de>
 
        PR rtl-optimization/61801
diff --git a/gcc/testsuite/gfortran.dg/pr61921.f90 b/gcc/testsuite/gfortran.dg/pr61921.f90
new file mode 100644 (file)
index 0000000..52b6176
--- /dev/null
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! { dg-options "-O2 -fipa-pta" }
+MODULE min_heap
+  TYPE heap_t
+  END TYPE heap_t
+CONTAINS
+  ELEMENTAL FUNCTION get_left_child(n) RESULT (child)
+    INTEGER, INTENT(IN)                      :: n
+  END FUNCTION get_left_child
+  ELEMENTAL FUNCTION get_value(heap, n) RESULT (value)
+    TYPE(heap_t), INTENT(IN)                 :: heap
+    INTEGER, INTENT(IN)                      :: n
+  END FUNCTION get_value
+END MODULE min_heap
+
index 1879fc0b8ff23346bd546e7b854cf2ad2d1767f9..0aa0c4bfd5bef97317abe8b1d0f3e050232e9f15 100644 (file)
@@ -5650,6 +5650,7 @@ create_variable_info_for_1 (tree decl, const char *name)
   auto_vec<fieldoff_s> fieldstack;
   fieldoff_s *fo;
   unsigned int i;
+  varpool_node *vnode;
 
   if (!declsize
       || !tree_fits_uhwi_p (declsize))
@@ -5671,7 +5672,8 @@ create_variable_info_for_1 (tree decl, const char *name)
         in IPA mode.  Else we'd have to parse arbitrary initializers.  */
       && !(in_ipa_mode
           && is_global_var (decl)
-          && varpool_node::get (decl)->get_constructor ()))
+          && (vnode = varpool_node::get (decl))
+          && vnode->get_constructor ()))
     {
       fieldoff_s *fo = NULL;
       bool notokay = false;