From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2159 invoked by alias); 9 Mar 2010 19:06:21 -0000 Received: (qmail 2125 invoked by uid 48); 9 Mar 2010 19:06:10 -0000 Date: Tue, 09 Mar 2010 19:06:00 -0000 Subject: [Bug fortran/43310] New: -pedantic errors on valid code involving PARAMETERs initialized to intrinsic function result X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "giese025 at umn dot edu" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-03/txt/msg00842.txt.bz2 Easier to explain with a trivial piece of code... PROGRAM BAR LOGICAL :: foo INTEGER,PARAMETER :: a = HUGE(1) INTEGER :: b b = HUGE(1) foo = NOT(a) >= 0 ! FAILS WITH -pedantic foo = NOT(b) >= 0 ! OK WITH -pedantic END PROGRAM BAR If -pedantic is used, then PARAMETERs appear to be handled differently then if -pedantic is not used. Moreover, this only seems to be an issue if the parameter is set to the result of some other function, e.g., huge. Additionally, the program compiles as expected if the same code is used but making the variable NOT a parameter. This code snippet hasn't been a problem with intel nor nag compilers. Nor is it a problem with gfortran if -pedantic is not used. I would expect this to not be a problem with gfortran when -pedantic is used. The error messege that I receive is [name@host dir]$ gfortran -c -pedantic bar.f90 bar.f90:6.12: foo = NOT(a) >= 0 ! FAILS* WITH -pedantic 1 Error: Result of NOT gives range error for its kind at (1) My version Using built-in specs. Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.4.2 20091222 (Red Hat 4.4.2-20) (GCC) -- Summary: -pedantic errors on valid code involving PARAMETERs initialized to intrinsic function result Product: gcc Version: 4.4.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: giese025 at umn dot edu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43310