This is an archive of the discontinued LLVM Phabricator instance.

[flang] Retrieve rank before updating the pointer
ClosedPublic

Authored by clementval on Dec 5 2022, 6:33 AM.

Details

Summary

The code is iterating on the rank of the pointer to set the bounds.
If the rank is retrieved after the pointer = target it does not
reflect the actual rank of the pointer.

This could happen in code like the following:

type t1
  integer :: a
end type

type(t), pointer :: p(:)
class(t), pointer :: q(:,:)
q(0:1,-2:2) => p(10:1:-1)

Diff Detail

Event Timeline

clementval created this revision.Dec 5 2022, 6:33 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 5 2022, 6:33 AM
clementval requested review of this revision.Dec 5 2022, 6:33 AM
klausler accepted this revision.Dec 5 2022, 7:28 AM
This revision is now accepted and ready to land.Dec 5 2022, 7:28 AM
This revision was landed with ongoing or failed builds.Dec 5 2022, 9:27 AM
This revision was automatically updated to reflect the committed changes.