This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/18890] New: ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one
- From: "naf at naf dot net dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Dec 2004 17:39:40 -0000
- Subject: [Bug fortran/18890] New: ICE at assign CHARACTER POINTER array to POINTER or ALLOCATABLE one
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Example code:
$ cat alloc.f90
INTEGER ERR,N
PARAMETER (N=10)
CHARACTER(LEN=40), POINTER :: vPTR(:)
CHARACTER(LEN=40), ALLOCATABLE :: vALLOC(:)
ALLOCATE(vPTR(N),STAT=ERR)
ALLOCATE(vALLOC(N),STAT=ERR)
vALLOC='A'
vPTR=vALLOC ! Line cause compiler error
WRITE(*,*) vPTR
DEALLOCATE(vPTR,STAT=ERR)
DEALLOCATE(vALLOC,STAT=ERR)
END
When compiling it an internal compiler errors arises:
$ /usr/local/bin/gfortran/irun/bin/gfortran -static -v --save-temps alloc.f90
Driving: /usr/local/bin/gfortran/irun/bin/gfortran -static -v -save-temps
alloc.f90 -lgfortranbegin -lgfortran -lm
Reading specs from
/usr/local/bin/gfortran/irun/bin/../lib/gcc/i686-pc-linux-gnu/4.0.0/specs
Configured with: ../gcc/configure --enable-languages=c,f95
--prefix=/usr/work/2004343/irun
Thread model: posix
gcc version 4.0.0 20041208 (experimental)
/usr/local/bin/gfortran/irun/bin/../libexec/gcc/i686-pc-linux-gnu/4.0.0/f951
alloc.f90 -quiet -dumpbase alloc.f90 -mtune=pentiumpro -auxbase alloc -version
-o alloc.s
GNU F95 version 4.0.0 20041208 (experimental) (i686-pc-linux-gnu)
compiled by GNU C version 4.0.0 20041202 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
alloc.f90: In function 'MAIN__':
alloc.f90:11: internal compiler error: in gfc_trans_scalar_assign, at
fortran/trans-expr.c:2005
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
ICE appears with CHARACTER type, REAL or INTEGER seems ok.
ICE appears only with POINTER to POINTER or mixed POINTER to/from
ALLOCATABLE arrays assigning, ALLOCATABLE to ALLOCATABLE have works.
--
Summary: ICE at assign CHARACTER POINTER array to POINTER or
ALLOCATABLE one
Product: gcc
Version: tree-ssa
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: naf at naf dot net dot ru
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18890