This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/54208] New: compilation error for ubound construct in PARAMETER statements
- From: "carlos.a.cruz at nasa dot gov" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 09 Aug 2012 15:41:58 +0000
- Subject: [Bug fortran/54208] New: compilation error for ubound construct in PARAMETER statements
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54208
Bug #: 54208
Summary: compilation error for ubound construct in PARAMETER
statements
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: carlos.a.cruz@nasa.gov
The following reproducer:
program testit
integer, parameter :: n=2
integer, dimension(1-min(n,2)/2:n) :: arr
integer, parameter :: i=ubound(arr,1)
write(6,*) i
end program testit
fails to compile:
>gfortran testit.F90
testit.F90:4.33:
integer, parameter :: i=ubound(arr,1)
1
Error: Array 'arr' at (1) is a variable, which does not reduce to a constant
expression
This error causes a problem when compiling GISS's climate model (modelE), which
has similar constructs, but it is not a problem with other compilers (e.g.
intel 12.1)
Additional information:
-----------------------
>gfortran --version
GNU Fortran (GCC) 4.8.0 20120401 (experimental)
Copyright (C) 2012 Free Software Foundation, Inc.
>gcc -v -save-temps testit.F90
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/other/SLES11/gcc/4.8-20120401/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with:
/gpfsm/dnbsrc/other/GCC/SLES11/4.8-20120401/gcc-4.8-20120401/configure
--prefix=/usr/local/other/SLES11/gcc/4.8-20120401 CC=gcc --enable-languages=all
Thread model: posix
gcc version 4.8.0 20120401 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-mtune=generic' '-march=x86-64'
/usr/local/other/SLES11/gcc/4.8-20120401/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/f951
testit.F90 -cpp=testit.f90 -quiet -v testit.F90 -quiet -dumpbase testit.F90
-mtune=generic -march=x86-64 -auxbase testit -version -fintrinsic-modules-path
/usr/local/other/SLES11/gcc/4.8-20120401/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/finclude
-o testit.s
GNU Fortran (GCC) version 4.8.0 20120401 (experimental)
(x86_64-unknown-linux-gnu)
compiled by GNU C version 4.8.0 20120401 (experimental), GMP version
4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory
"/usr/local/other/SLES11/gcc/4.8-20120401/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/other/SLES11/gcc/4.8-20120401/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/finclude
/usr/local/other/SLES11/gcc/4.8-20120401/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include
/usr/local/include
/usr/local/other/SLES11/gcc/4.8-20120401/include
/usr/local/other/SLES11/gcc/4.8-20120401/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include-fixed
/usr/include
End of search list.