This is an archive of the discontinued LLVM Phabricator instance.

[flang] Accommodate arrays with a zero-extent dimension in location folding
ClosedPublic

Authored by klausler on Mar 7 2022, 8:17 AM.

Details

Summary

The index incrementation code used for FINDLOC, MAXLOC, and MINLOC folding
would crash if the array had a zero extent on the dimension selected with
a DIM= argument since the subscript passed to IncrementSubscripts would
have a value less than the lower bound. Fix, and add tests.

Diff Detail

Event Timeline

klausler created this revision.Mar 7 2022, 8:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2022, 8:17 AM
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.Mar 7 2022, 8:17 AM
PeteSteinfeld accepted this revision.Mar 7 2022, 8:53 AM

All builds and tests correctly and looks good.

This revision is now accepted and ready to land.Mar 7 2022, 8:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2022, 10:44 AM