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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #1 from kargl at gcc dot gnu.org ---
(In reply to Tobias Burnus from comment #0)
> 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.

I think that you may be wrongly interpreting what the standard says.  (7)
clearly does not apply to your code because a(2:1) is a zero-sized array
section.

What I think you're missing from 22-007.pdf, page 104,

   It is processor dependent whether any other object is contiguous.

and a zero-sized entity falls under this statement.  Then on page 94, we have

   An empty sequence forms a zero-sized array.

As the sequence is empty, it can be neither contiguous nor discontiguous.

Reply via email to