From: Francois-Xavier Coudert Date: Sun, 15 Jun 2014 19:35:11 +0000 (+0000) Subject: backport: re PR fortran/45187 (ICE with CRAY pointer in module) X-Git-Tag: releases/gcc-4.8.4~411 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1526715c36ce44e49506b5b2b1ab70e85e604b2;p=thirdparty%2Fgcc.git backport: re PR fortran/45187 (ICE with CRAY pointer in module) Backport from trunk PR fortran/45187 * trans-decl.c (gfc_create_module_variable): Don't create Cray-pointee decls twice. * gfortran.dg/cray_pointers_10.f90: New file. From-SVN: r211688 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4fbaf80e2cf8..8033c7a5cc29 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2014-06-15 Francois-Xavier Coudert + + Backport from trunk. + PR fortran/45187 + * trans-decl.c (gfc_create_module_variable): Don't create + Cray-pointee decls twice. + 2014-05-26 Janne Blomqvist Backport from mainline diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 7d23561872b1..b4b0fc536b01 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -4084,8 +4084,8 @@ gfc_create_module_variable (gfc_symbol * sym) } /* Don't generate variables from other modules. Variables from - COMMONs will already have been generated. */ - if (sym->attr.use_assoc || sym->attr.in_common) + COMMONs and Cray pointees will already have been generated. */ + if (sym->attr.use_assoc || sym->attr.in_common || sym->attr.cray_pointee) return; /* Equivalenced variables arrive here after creation. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b58c46f208a1..4fd2ef0b81b5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-06-15 Francois-Xavier Coudert + + Backport from trunk. + PR fortran/45187 + * gfortran.dg/cray_pointers_10.f90: New file. + 2014-06-13 Peter Bergner Backport from mainline diff --git a/gcc/testsuite/gfortran.dg/cray_pointers_10.f90 b/gcc/testsuite/gfortran.dg/cray_pointers_10.f90 new file mode 100644 index 000000000000..1ac98f3ea46f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/cray_pointers_10.f90 @@ -0,0 +1,18 @@ +! { dg-do run } +! { dg-options "-fcray-pointer" } +! +! PR fortran/45187 +! +module foo + implicit none + real :: a + pointer(c_a, a) +end module foo + +program test + use foo + real :: z + c_a = loc(z) + a = 42 + if (z /= 42) call abort +end program test