public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "giese025 at umn dot edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/43310]  New: -pedantic errors on valid code involving PARAMETERs initialized to intrinsic function result
Date: Tue, 09 Mar 2010 19:06:00 -0000	[thread overview]
Message-ID: <bug-43310-18897@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2010-03-09 19:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-09 19:06 giese025 at umn dot edu [this message]
2010-03-09 19:41 ` [Bug fortran/43310] " kargl at gcc dot gnu dot org
2010-03-09 20:45 ` dominiq at lps dot ens dot fr
2010-03-09 21:06 ` kargl at gcc dot gnu dot org
2010-03-10  1:17 ` giese025 at umn dot edu
2010-03-10  3:15 ` kargl at gcc dot gnu dot org
2010-03-10 16:07 ` giese025 at umn dot edu
2010-03-10 17:17 ` kargl at gcc dot gnu dot org
2010-03-13  1:18 ` [Bug fortran/43310] -pedantic errors involving PARAMETERs and out of range result pinskia at gcc dot gnu dot org
2010-03-13  3:52 ` kargl at gcc dot gnu dot org
2010-03-17 20:16 ` burnus at gcc dot gnu dot org
2010-03-17 21:31 ` dominiq at lps dot ens dot fr
2010-03-17 22:20 ` kargl at gcc dot gnu dot org
2010-03-17 22:27 ` kargl at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-43310-18897@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).