From: Martin Jambor Date: Tue, 19 Jul 2016 15:40:43 +0000 (+0200) Subject: re PR fortran/71688 (ICE in analyze, at cgraphunit.c:632 with -fcoarray=lib) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e7980addd0537e0d053371ef8094d019ac52dfbf;p=gcc.git re PR fortran/71688 (ICE in analyze, at cgraphunit.c:632 with -fcoarray=lib) Fix PR fortran/71688 2016-07-19 Martin Jambor 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b6d25c38179..c25a1d38e08 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-07-19 Martin Jambor + + 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 * gimple-fold.c (get_base_constructor): Add VIEW_CONVERT case, diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 6c9bf50a69a..69ddd17f173 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 930a6e8f825..36574564a0c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-07-19 Martin Jambor + + PR fortran/71688 + * gfortran.dg/pr71688.f90: New test. + 2016-07-19 Richard Biener * 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 index 00000000000..dbb6d185cf4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr71688.f90 @@ -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