[flang] _FortranAExit does not have [[noreturn]] semantic
Open
flang
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
For the following code:
```fortran
integer function KOHb_exit(status)
integer, intent(in) :: status
if (status > 0) call exit(status) ! actually, _FortranAExit
KOHb_exit = 0
do i = 1, status
print '(A,I0)', "KOHb #", i
end do
end function KOHb_exit
```
one would expect that this code will never have print statement in ASM at high level of optimizations, since execution after `exit` is not possible. However, current LLVM flang generates print statements at -O3:
https://godbolt.org/z/EzK3nWfrq
For `error stop` (as well as `stop`), the code looks cool:
https://godbolt.org/z/7bvhf4Ef3
Contributor guide
Assessment
This issue has not been assessed yet.