https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97320

Jacques Le Bourlot <Jacques.Lebourlot at obspm dot fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Jacques.Lebourlot at obspm dot 
fr

--- Comment #2 from Jacques Le Bourlot <Jacques.Lebourlot at obspm dot fr> ---
Same here.

This is annoying because *some* warnings ARE relevant, and I need them to clean
a huge (and old) code. But they are lost in too many false positives.

Here is the test case I can provide (similar to Tomas')

-----------------------------
PROGRAM Warn_Bug

   INTEGER, PARAMETER      :: N = 2
   INTEGER, DIMENSION(0:N) :: a
   INTEGER                 :: i

   a = [ (i, i = 0, N) ]

   DO i = 0, N
      IF (i == 0) THEN
         PRINT *, " Do nothing"
      ELSE IF (i >= 1) THEN
         PRINT *, " OK:", a(i) - a(i-1)
      ENDIF
   ENDDO

END PROGRAM Warn_Bug
-----------------------------

The compiler should see that "IF (i >= 1)" THEN "i-1 >= 0". Quoting the manual
is not an adequate answer. An upgrade would be most welcomed.

Thank you.

Jacques

Reply via email to