This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Pointer initialization error under gfortran 4.6
- From: Andrew Benson <abenson at its dot caltech dot edu>
- To: fortran at gcc dot gnu dot org
- Cc: Andrew Benson <abenson at its dot caltech dot edu>
- Date: Mon, 30 Aug 2010 12:49:09 -0700
- Subject: Pointer initialization error under gfortran 4.6
I'm getting an error while compiling a code under the latest gfortran 4.6
(checked out from svn this morning), which compiled successfully under
gfortran 4.6 as checked out from svn on Friday.
In particular, when compiling one file I get:
<During initialization>
Error: Pointer initialization target at (1) must have the SAVE attribute
f951: internal compiler error: in gfc_enforce_clean_symbol_state, at
fortran/symbol.c:3452
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
I've reduced this to a minimal case which reproduces the error (although not
the ICE). The code is attached:
$ gfortran -c objects.merger_trees.F90 -o objects.merger_trees.o
<During initialization>
Error: Pointer initialization target at (1) must have the SAVE attribute
Removing the line:
procedure :: getNode => Tree_Node_Get
results in a successful compile, so this seems to be related to the type-bound
procedure.
Thanks for any help you can offer.
-Andrew.
--
$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/i686-pc-linux-
gnu/4.6.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.6/configure --prefix=/usr/local/gcc-trunk --enable-
languages=c,c++,fortran --disable-multilib --with-gmp=/usr/local --with-
mpc=/usr/local --with-mpfr=/usr/local
Thread model: posix
gcc version 4.6.0 20100830 (experimental) (GCC)
--
* Andrew Benson: http://www.tapir.caltech.edu/~abenson/contact.html
* Galacticus: http://sites.google.com/site/galacticusmodel
module Merger_Trees
private
public :: mergerTree
type mergerTree
contains
procedure :: getNode => Tree_Node_Get
end type mergerTree
contains
function Tree_Node_Get(thisTree,nodeIndex) result(foundNode)
implicit none
class(mergerTree), intent(inout) :: thisTree
integer, intent(in) :: nodeIndex
integer, pointer :: foundNode
return
end function Tree_Node_Get
end module Merger_Trees