[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-fortran
Subject:    Re: non-contiguous target error
From:       Cesar Philippidis <cesar_philippidis () mentor ! com>
Date:       2018-05-18 13:42:32
Message-ID: 4e887ef6-73d6-95c7-4dab-6fe81e6850af () mentor ! com
[Download RAW message or body]

On 05/18/2018 02:08 AM, Arjen Markus wrote:

>> I noticed that gfortran 8 now errors when contiguous pointers point
>> to non-explicitly contiguous targets. E.g.
>> 
>> program test implicit none real,pointer :: p1(:) 
>>  real,pointer,contiguous :: p2(:,:,:)
>> 
>>  allocate(p1(12))
>> 
>>  p2(1:2,1:2,1:2) => p1(4:) end program
>> 
>> This behavior seems to be too strict. Maybe it should be a
>> warning?
>> 
> 
> I do not have gfortran 8 available, so I cannot check my idea, but
> the array section p1(4:) is 9 elements long and the pointer p2 is 8
> elements. Could the error message come from that discrepancy?

Good point, but the program still fails when I allocate 20 elements for p1.

Cesar
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic