When compiling the code (taken and simplified from FoX, the FORTRAN XML
library):
module charset
implicit none
private
character(len=1), parameter :: SPACE = achar(32)
character(len=1), parameter :: NEWLINE = achar(10)
character(len=1), parameter :: CARRIAGE_RETURN = achar(13)
character(len=1), parameter :: TAB = achar(9)
! ** taking the last one or two items out of the concatenation allows
compilation
character(len=*), parameter :: whitespace =
SPACE//NEWLINE//CARRIAGE_RETURN//TAB
public :: whitespace
public :: allowed_encoding
contains
function allowed_encoding(encoding) result(p)
character(len=*), intent(in) :: encoding
logical :: p
character(len=100) :: enc
logical :: utf8, usascii, iso88591
! ** restoring the next line allows compilation
! utf8 = .false.
p = utf8.or.usascii.or.iso88591
stop
end function allowed_encoding
end module charset
with the command: gfortran -v -save-temps -c testbug.f90
I get an Internal Error:
Using built-in specs.
Target: i386-apple-darwin9.2.0
Configured with: ../gcc-4.4-20080509/configure --enable-languages=fortran
Thread model: posix
gcc version 4.4.0 20080509 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.5.3' '-v' '-save-temps' '-c'
'-mtune=generic'
/usr/local/libexec/gcc/i386-apple-darwin9.2.0/4.4.0/f951 testbug.f90 -fPIC
-quiet -dumpbase testbug.f90 -mmacosx-version-min=10.5.3 -mtune=generic
-auxbase testbug -version -fintrinsic-modules-path
/usr/local/lib/gcc/i386-apple-darwin9.2.0/4.4.0/finclude -o testbug.s
GNU Fortran (GCC) version 4.4.0 20080509 (experimental)
(i386-apple-darwin9.2.0)
compiled by GNU C version 4.4.0 20080509 (experimental), GMP version
4.2.1, MPFR version 2.2.1.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
testbug.f90: In function ‘allowed_encoding’:
testbug.f90:19: internal compiler error: in gfc_conv_expr, at
fortran/trans-expr.c:3589
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
--
Summary: Internal compiler error: in gfc_conv_expr
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: j dot wookey at bristol dot ac dot uk
GCC build triplet: ../gcc-4.4-20080509/configure --enable-
languages=fortran
GCC target triplet: i386-apple-darwin9.2.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36652