This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/56666] New: Suppression flag for " DO loop at (1) will be executed zero times"


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56666

             Bug #: 56666
           Summary: Suppression flag for " DO loop at (1) will be executed
                    zero times"
    Classification: Unclassified
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: haugboel@gmail.com


When running the gfortran compiler on source files with zero-trip do loops,
such as

do i=1,0
  ...do..something...
enddo

the compiler will complain with the warning :

Warning: DO loop at (1) will be executed zero times
test.f90:10.12:

   do i=1,0
           1
Warning: DO loop at (1) will be executed zero times

We have a code, which makes use of preprocessing to select different
configurations. In the default configuration there are hundreds of these kind
of loops. The warning makes it harder to spot other warnings and errors.

It would be nice if it were possible to suppress/enable the warning with a flag
like

-Wzerotrip
-Wno-zerotrip


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]