This is an archive of the discontinued LLVM Phabricator instance.

[flang][runtime] Emit error message rather than crashing for MOD(ULO)(x,P=0)
ClosedPublic

Authored by klausler on Jun 3 2022, 4:11 PM.

Details

Summary

Add extra arguments and checks to the runtime support library so that
a call to the intrinsic functions MOD and MODULO with "denominator"
argument P of zero will cause a crash with a source location rather
than an uninformative floating-point error or integer division by
zero signal.

Additional work is required in lowering to (1) pass source file path and
source line number arguments and (2) actually call these runtime
library APIs instead of emitting inline code for MOD &/or MODULO.

Diff Detail

Event Timeline

klausler created this revision.Jun 3 2022, 4:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 3 2022, 4:11 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.Jun 3 2022, 4:11 PM
vdonaldson accepted this revision.Jun 3 2022, 5:31 PM
This revision is now accepted and ready to land.Jun 3 2022, 5:31 PM
This revision was landed with ongoing or failed builds.Jun 4 2022, 11:06 AM
This revision was automatically updated to reflect the committed changes.