https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105759
Bug ID: 105759
Summary: is_contiguous(zero_size_array(2:0)) wrongly returns
.true.
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: burnus at gcc dot gnu.org
Target Milestone: ---
GCC and ifort both return T for the following code:
integer :: a(2)
print *, is_contiguous(a(2:1))
end
However, I think that should be F / .false. as F2018 has:
8.5.7 CONTIGUOUS attribute
...
An object is contiguous if it is
...
(7) a nonzero-sized array section (9.5.3) provided that
...
Disclaimer: I might have missed something.
If it is a bug, then we probably need to fix both the simplify.cc compile-time
and libgfortran run-time check.