[flang] Fix rank and byte stride in pointer remapping
authorValentin Clement <clementval@gmail.com>
Wed, 8 Feb 2023 16:55:38 +0000 (17:55 +0100)
committerValentin Clement <clementval@gmail.com>
Wed, 8 Feb 2023 16:56:15 +0000 (17:56 +0100)
commit6a63e21cf4e6a8499d90e2337eb545644646ee31
tree7ecc8050ae0d6e7bf2aeb95380e2156beada537b
parentcb19b83baac1a204cb61e7fd7c8f22dac886ce39
[flang] Fix rank and byte stride in pointer remapping

In some remapping case the rank of the pointer is different
from the target one.

```
program remap
  type :: p
    integer :: a
  end type t
  type(p), target :: ta(10) = [ (t(i),i=1,10) ]
  class(t), pointer :: p(:,:)
  p(1:2,1:5) => ta
end
```

This patch updates the rank and the byte stride to fix such case.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D143566
flang/runtime/pointer.cpp