This is an archive of the discontinued LLVM Phabricator instance.

[flang] Support extention intrinsic ABORT
ClosedPublic

Authored by peixin on Jul 24 2022, 4:30 AM.

Details

Summary

The semantic checks and runtime have been supported. This supports the
lowering of intrinsic ABORT.

gfortran prints a backtrace before abort, unless -fno-backtrace is
given. This is good to use. The intrinsic BACKTRACE is not supported
yet, so add TODO in the runtime.

This extention is needed in SPEC2017 521.wrf_r in
https://github.com/llvm/llvm-project/issues/55955.

Diff Detail

Event Timeline

peixin created this revision.Jul 24 2022, 4:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2022, 4:30 AM
peixin requested review of this revision.Jul 24 2022, 4:30 AM
peixin added inline comments.
flang/runtime/stop.cpp
146

@klausler Can I add this TODO here?

klausler added inline comments.Jul 25 2022, 10:19 AM
flang/runtime/stop.cpp
146

Compilers that have ABORT as an extension intrinsic or as a standard library utility do so as a means to access the standard C library function abort (std::abort), which simply sends SIGABRT to the current process. Does any Fortran compiler emit a backtrace before doing so? If not, f18 should not either.

peixin added inline comments.Jul 25 2022, 7:01 PM
flang/runtime/stop.cpp
146

Yes, gfortran emit a braktrace as I mentioned in the summary. Here is the details in gfortran, and here is the testing.

peixin added inline comments.Jul 31 2022, 6:51 PM
flang/runtime/stop.cpp
146
klausler accepted this revision.Aug 1 2022, 8:21 AM
This revision is now accepted and ready to land.Aug 1 2022, 8:21 AM
This revision was automatically updated to reflect the committed changes.