This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix rank and byte stride in pointer remapping
ClosedPublic

Authored by clementval on Feb 8 2023, 2:49 AM.

Details

Summary

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.

Diff Detail

Event Timeline

clementval created this revision.Feb 8 2023, 2:49 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 8 2023, 2:49 AM
Herald added a subscriber: sunshaoce. · View Herald Transcript
clementval requested review of this revision.Feb 8 2023, 2:49 AM
klausler accepted this revision.Feb 8 2023, 8:52 AM

Looks great; thank you for debugging this.

This revision is now accepted and ready to land.Feb 8 2023, 8:52 AM
This revision was automatically updated to reflect the committed changes.