http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45424
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-05-09
16:02:18 UTC ---
(In reply to comment #1)
> a) Array element with nonzero strides
I meant: A an array containing a single element and having a nonunity stride.
> type t
> integer :: i, j
> end type t
> print *, is_contiguous(x(:)%i) ! Shall be false - but prints "true".
Those kind of arguments can get really tricky! Assume as component a:
integer :: i(1) ! or "i(2)
or
class(t), allocatable :: a
or
integer, allocatable :: a(:)
which is accessed as "is_contiguous(x(:)%a(1))".
Intel and Cray handle it simply: by always returning "F" - even for "type t;
integer :: i; end type", which should have no padding and be contiguous in
memory. We could do the same - or we rule out BT_CLASS, arrays and coarrays and
do then a size check: whole derived type == expr->ts.type size.
Another issue are substrings. For those one needs to check that the substring
range matches the string length.