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/81839] doduc.f90 undefined behavior warning


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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-08-13
   Target Milestone|7.3                         |8.0
            Summary|[7/8 Regression] doduc.f90  |doduc.f90 undefined
                   |undefined behavior warning  |behavior warning
     Ever confirmed|0                           |1
           Severity|normal                      |enhancement

--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
This is a sort-of bug in doduc.f90 - the code is wrong, but
never executed.

Actually, a warning is justified, even if it is confusing.

Reduced test case:

       subroutine foo
       IMPLICIT DOUBLE PRECISION(A-H,O-Z)

       COMMON /AAA77/ QCOni(2) , QUGii(2) , TMI(2)
       DO ij = 1 , 3
          QUGii(ij) = 0.
          QCOni(ij) = 0.
       ENDDO
       END

Problem is that the code tries to access elements
qconi(3) and qugii(3) - both outside the bounds.

So, not a regression.

What we _could_ do is to warn about it a bit more clearly.

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