This is an archive of the discontinued LLVM Phabricator instance.

[flang] MERGE result is polymorphic only if TSOURCE and FSOURCE are polymorphic
ClosedPublic

Authored by clementval on Mar 1 2023, 5:10 AM.

Details

Summary

16.9.129 point 4: the result is polymorphic if and only if both TSOURCE and
FSOURCE are polymorphic.

If neither TSOURCE and FSOURCE are polymorphic then the current behavior is
preserved.

Depends on D145058

Diff Detail

Event Timeline

clementval created this revision.Mar 1 2023, 5:10 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 1 2023, 5:10 AM
clementval requested review of this revision.Mar 1 2023, 5:10 AM
jeanPerier accepted this revision.Mar 1 2023, 6:00 AM

LGTM

flang/lib/Optimizer/Builder/IntrinsicCall.cpp
3930

I think it is important to tell that TSOURCE and FSOURCE must have the same dynamic type in this case so the polymorphic one can be converted instead of being reboxed to the declared type.

This revision is now accepted and ready to land.Mar 1 2023, 6:00 AM
clementval marked an inline comment as done.Mar 1 2023, 6:43 AM
clementval added inline comments.
flang/lib/Optimizer/Builder/IntrinsicCall.cpp
3930

Right. I'll update the comment before submitting.