This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
ICE with size() on character pointer
- From: Angelo Graziosi <graziosi dot angelo at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Date: Sat, 17 Nov 2012 00:48:47 +0100
- Subject: ICE with size() on character pointer
I want to flag that the following simple test code
$ cat ice_test.f90
program ice_test
implicit none
write(*,*) 'message: ', size(Error_Msg),Error_Msg()
contains
function Error_Msg() result(ErrorMsg)
character, dimension(:), pointer :: ErrorMsg
character, dimension(1), target :: str = '!'
ErrorMsg => str
end function Error_Msg
end program ice_test
gives an ICE,
$ gfortran ice_test.f90
ice_test.f90: In function 'ice_test':
ice_test.f90:3:0: internal compiler error: in gfc_conv_intrinsic_size, at fortran/trans-intrinsic.c:5059
Please submit a full bug report,
with preprocessed source if appropriate.
on the following systems:
- Mac OS X 10.7.5 with gcc46, gcc47 (installed with MacPorts)
- Cygwin 1.7.17 with a recent gcc48 snapshot
- GNU/Linux Kubuntu 12.04 with gcc46.
The same code fails to build with gcc45 (Cygwin, Mac OS X):
$ gfortran-mp-4.5 ice_test.f90
ice_test.f90:3.31:
write(*,*) 'message: ', size(Error_Msg),Error_Msg()
1
Error: Internal procedure 'error_msg' is not allowed as an actual argument at (1)
Ciao,
Angelo.