re PR fortran/71688 (ICE in analyze, at cgraphunit.c:632 with -fcoarray=lib)
authorMartin Jambor <mjambor@suse.cz>
Tue, 19 Jul 2016 15:40:43 +0000 (17:40 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Tue, 19 Jul 2016 15:40:43 +0000 (17:40 +0200)
Fix PR fortran/71688

2016-07-19  Martin Jambor  <mjambor@suse.cz>

        PR fortran/71688
        * trans-decl.c (gfc_generate_function_code): Use cgraph_get_create_node
        rather than cgraph_create_node to get a call graph node.

testsuite/
        gfortran.dg/pr71688.f90: New test.

From-SVN: r238476

gcc/ChangeLog
gcc/fortran/trans-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr71688.f90 [new file with mode: 0644]

index b6d25c3817924e0a69c33d8ddeb4f343d7a3de47..c25a1d38e08304263ad98b78307d4651f44290ef 100644 (file)
@@ -1,3 +1,9 @@
+2016-07-19  Martin Jambor  <mjambor@suse.cz>
+
+        PR fortran/71688
+        * trans-decl.c (gfc_generate_function_code): Use cgraph_get_create_node
+        rather than cgraph_create_node to get a call graph node.
+
 2016-07-19  Richard Biener  <rguenther@suse.de>
 
        * gimple-fold.c (get_base_constructor): Add VIEW_CONVERT case,
index 6c9bf50a69aa7b4993f0238df8583c72106fd713..69ddd17f173de5bbaae34100c39b664359b0d3eb 100644 (file)
@@ -6372,7 +6372,7 @@ gfc_generate_function_code (gfc_namespace * ns)
         function has already called cgraph_create_node, which also created
         the cgraph node for this function.  */
       if (!has_coarray_vars || flag_coarray != GFC_FCOARRAY_LIB)
-       (void) cgraph_node::create (fndecl);
+       (void) cgraph_node::get_create (fndecl);
     }
   else
     cgraph_node::finalize_function (fndecl, true);
index 930a6e8f825305a22a7df4accc66dc238327c460..36574564a0cb768998879129baab2db1ab72d513 100644 (file)
@@ -1,3 +1,8 @@
+2016-07-19  Martin Jambor  <mjambor@suse.cz>
+
+        PR fortran/71688
+        * gfortran.dg/pr71688.f90: New test.
+
 2016-07-19  Richard Biener  <rguenther@suse.de>
 
        * c-c++-common/vector-subscript-6.c: New testcase.
diff --git a/gcc/testsuite/gfortran.dg/pr71688.f90 b/gcc/testsuite/gfortran.dg/pr71688.f90
new file mode 100644 (file)
index 0000000..dbb6d18
--- /dev/null
@@ -0,0 +1,13 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=lib" }
+
+program p
+   call s
+contains
+   subroutine s
+      real :: x[*] = 1
+      block
+      end block
+      x = 2
+   end
+end