This is an archive of the discontinued LLVM Phabricator instance.

[flang][hlfir] Propagate non-default lbounds from the mutable box.
ClosedPublic

Authored by vzakhari on Jun 7 2023, 5:16 PM.

Details

Summary

The issue affected type select tests, such that inside the type guard
block the associated variable was using default lbounds instead of
inheriting it from the original variable.

The bridge's genExprBox ended up creating BoxValue from a MutableBoxValue
without setting non-default lbounds. So the hlfir.declare generated
for the associated name inside the type guard block was also using
the default lbounds. The fix is to read the value of the mutable box
and propagate the lbounds to the new BoxValue.

The fix might affect more than just select type cases.

Diff Detail

Event Timeline

vzakhari created this revision.Jun 7 2023, 5:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2023, 5:16 PM
vzakhari requested review of this revision.Jun 7 2023, 5:16 PM
tblah accepted this revision.Jun 8 2023, 3:37 AM

LGTM

This revision is now accepted and ready to land.Jun 8 2023, 3:37 AM