This is an archive of the discontinued LLVM Phabricator instance.

[flang] Set lower bounds of array section fir.embox to one
ClosedPublic

Authored by jeanPerier on Apr 5 2022, 5:51 AM.

Details

Summary

Do not use the shift of a fir.embox to set lower bounds if there is
a fir.slice operand. This matches Fortran semantics where lower bounds
of array sections are ones.
Note that in case there is a fir.slice, the array shift may be provided
because it is used to calculate the origin/base address of an array slice.

Add a TODO for substring codegen since I noticed it was not upstreamed
yet and would cause some program to silently compile incorrectly.

Diff Detail

Event Timeline

jeanPerier created this revision.Apr 5 2022, 5:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2022, 5:51 AM
jeanPerier requested review of this revision.Apr 5 2022, 5:51 AM
This revision is now accepted and ready to land.Apr 5 2022, 5:53 AM