This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/81839] doduc.f90 undefined behavior warning
- From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 13 Aug 2017 17:32:05 +0000
- Subject: [Bug fortran/81839] doduc.f90 undefined behavior warning
- Auto-submitted: auto-generated
- References: <bug-81839-4@http.gcc.gnu.org/bugzilla/>
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.