#
3da7de34 |
| 24-Jan-2025 |
Slava Zakharin <szakharin@nvidia.com> |
[flang][runtime] Disable optimization for traceback related functions. (#124172)
The backtrace may at least print the backtrace name in the call stack,
but this does not happen with the release bui
[flang][runtime] Disable optimization for traceback related functions. (#124172)
The backtrace may at least print the backtrace name in the call stack,
but this does not happen with the release builds of the runtime.
Surprisingly, specifying "no-omit-frame-pointer" did not work
with GCC, so I decided to fall back to -O0 for these functions.
show more ...
|
#
7326e903 |
| 02-Jan-2025 |
Brooks Davis <brooks@one-eyed-alien.net> |
flang: fix backtrace build on FreeBSD (#120297)
FreeBSD's libexecinfo defines backtrace with a size_t for the size
argument and return type. This almost certainly doesn't make sense, but
what's do
flang: fix backtrace build on FreeBSD (#120297)
FreeBSD's libexecinfo defines backtrace with a size_t for the size
argument and return type. This almost certainly doesn't make sense, but
what's done is done so cast the output to allow compilation. Otherwise
we get:
.../flang/runtime/stop.cpp:165:13: error: non-constant-expression cannot
be narrowed from type 'size_t' (aka 'unsigned long') to 'int' in
initializer list [-Wc++11-narrowing]
165 | int nptrs{backtrace(buffer, MAX_CALL_STACK)};
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
show more ...
|
#
e8baa792 |
| 10-Dec-2024 |
执着 <118413413+dty2@users.noreply.github.com> |
Backtrace support for flang (#118179)
Fixed build failures in old PRs due to missing files
|
#
1858a4eb |
| 28-Nov-2024 |
Tom Eccles <tom.eccles@arm.com> |
Revert "[flang]Add new intrinsic function backtrace and complete the TODO of abort" (#117990)
Reverts llvm/llvm-project#117603 due to failed buildbot
https://lab.llvm.org/buildbot/#/builders/152/bu
Revert "[flang]Add new intrinsic function backtrace and complete the TODO of abort" (#117990)
Reverts llvm/llvm-project#117603 due to failed buildbot
https://lab.llvm.org/buildbot/#/builders/152/builds/710
The important bit of the log was
```
FAILED: CMakeFiles/FortranRuntime.dir/stop.cpp.o
ccache /usr/bin/g++ -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DRT_USE_LIBCUDACXX=1 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/flang/runtime/../include -I/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/build -I/home/buildbot/worker/third-party/nv/cccl/libcudacxx/include -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -Wimplicit-fallthrough -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-lto -O3 -DNDEBUG -U_GLIBCXX_ASSERTIONS -U_LIBCPP_ENABLE_ASSERTIONS -UNDEBUG -std=c++17 -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -MD -MT CMakeFiles/FortranRuntime.dir/stop.cpp.o -MF CMakeFiles/FortranRuntime.dir/stop.cpp.o.d -o CMakeFiles/FortranRuntime.dir/stop.cpp.o -c /home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/flang/runtime/stop.cpp
/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/flang/runtime/stop.cpp:19:10: fatal error: llvm/Config/config.h: No such file or directory
19 | #include "llvm/Config/config.h"
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
```
CC @dty2
show more ...
|
#
159e6012 |
| 28-Nov-2024 |
执着 <118413413+dty2@users.noreply.github.com> |
[flang]Add new intrinsic function backtrace and complete the TODO of abort (#117603)
Hey guys, I found that Flang's built-in ABORT function is incomplete
when I was using it. Compared with gfortran
[flang]Add new intrinsic function backtrace and complete the TODO of abort (#117603)
Hey guys, I found that Flang's built-in ABORT function is incomplete
when I was using it. Compared with gfortran's ABORT (which can both
abort and print out a backtrace), flang's ABORT implementation lacks the
function of printing out a backtrace. This feature is essential for
debugging and understanding the call stack at the failure point.
To solve this problem, I completed the "// TODO:" of the abort function,
and then implemented an additional built-in function BACKTRACE for
flang. After a brief reading of the relevant source code, I used
backtrace and backtrace_symbols in "execinfo.h" to quickly implement
this. But since I used the above two functions directly, my
implementation is slightly different from gfortran's implementation (in
the output, the function call stack before main is additionally output,
and the function line number is missing). In addition, since I used the
above two functions, I did not need to add -g to embed debug information
into the ELF file, but needed -rdynamic to ensure that the symbols are
added to the dynamic symbol table (so that the function name will be
printed out).
Here is a comparison of the output between gfortran 's backtrace and my
implementation:
gfortran's implemention output:
```
#0 0x557eb71f4184 in testfun2_
at /home/hunter/plct/fortran/test.f90:5
#1 0x557eb71f4165 in testfun1_
at /home/hunter/plct/fortran/test.f90:13
#2 0x557eb71f4192 in test_backtrace
at /home/hunter/plct/fortran/test.f90:17
#3 0x557eb71f41ce in main
at /home/hunter/plct/fortran/test.f90:18
```
my impelmention output:
```
Backtrace:
#0 ./test(_FortranABacktrace+0x32) [0x574f07efcf92]
#1 ./test(testfun2_+0x14) [0x574f07efc7b4]
#2 ./test(testfun1_+0xd) [0x574f07efc7cd]
#3 ./test(_QQmain+0x9) [0x574f07efc7e9]
#4 ./test(main+0x12) [0x574f07efc802]
#5 /usr/lib/libc.so.6(+0x25e08) [0x76954694fe08]
#6 /usr/lib/libc.so.6(__libc_start_main+0x8c) [0x76954694fecc]
#7 ./test(_start+0x25) [0x574f07efc6c5]
```
test program is:
```
function testfun2() result(err)
implicit none
integer :: err
err = 1
call backtrace
end function testfun2
subroutine testfun1()
implicit none
integer :: err
integer :: testfun2
err = testfun2()
end subroutine testfun1
program test_backtrace
call testfun1()
end program test_backtrace
```
I am well aware of the importance of line numbers, so I am now working
on implementing line numbers (by parsing DWARF information) and
supporting cross-platform (Windows) support.
show more ...
|
#
b6686e76 |
| 21-Aug-2024 |
serge-sans-paille <sergesanspaille@free.fr> |
[Flang][Runtime] Handle missing definitions in <cfenv> (#101242)
According to the C99 standard, <fenv.h> may not define FE_INVALID and
the likes. Even if C++11 mandate them, musl and emscripten don
[Flang][Runtime] Handle missing definitions in <cfenv> (#101242)
According to the C99 standard, <fenv.h> may not define FE_INVALID and
the likes. Even if C++11 mandate them, musl and emscripten don't provide
them, so handle that case.
show more ...
|
#
1f9212d8 |
| 02-Aug-2022 |
Peixin Qiao <qiaopeixin@huawei.com> |
[flang] Support extention intrinsic ABORT
The semantic checks and runtime have been supported. This supports the lowering of intrinsic ABORT.
`gfortran` prints a backtrace before abort, unless `-fn
[flang] Support extention intrinsic ABORT
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.
Reviewed By: klausler
Differential Revision: https://reviews.llvm.org/D130439
show more ...
|
#
93ee5882 |
| 01-Feb-2022 |
Peter Steinfeld <psteinfeld@nvidia.com> |
[flang] Rename the runtime routine that reports a fatal user error
As per Steve Scalpone's suggestion, I've renamed the runtime routine to better evoke its purpose.
I implemented a routine called "
[flang] Rename the runtime routine that reports a fatal user error
As per Steve Scalpone's suggestion, I've renamed the runtime routine to better evoke its purpose.
I implemented a routine called "Crash" and added a test.
Differential Revision: https://reviews.llvm.org/D118703
show more ...
|
#
eb933225 |
| 28-Jan-2022 |
Peter Steinfeld <psteinfeld@nvidia.com> |
[flang] Implement a runtime routine to report fatal errors with source position
The title says it all.
I implemented a routine called "Crash" and added a test.
Differential Revision: https://revie
[flang] Implement a runtime routine to report fatal errors with source position
The title says it all.
I implemented a routine called "Crash" and added a test.
Differential Revision: https://reviews.llvm.org/D118509
show more ...
|
#
7796d81a |
| 18-Nov-2021 |
Jean Perier <jperier@nvidia.com> |
[flang] Skip `Fortran STOP:` before message when NO_STOP_MESSAGE is set
In 'STOP bye bye', do not print 'Fortran STOP:` before 'bye bye' when NO_STOP_MESSAGE environment variable is set at runtime.
[flang] Skip `Fortran STOP:` before message when NO_STOP_MESSAGE is set
In 'STOP bye bye', do not print 'Fortran STOP:` before 'bye bye' when NO_STOP_MESSAGE environment variable is set at runtime.
Also only exit with code 1 in StopStatementText if this is an ERROR STOP. This matches other compiler behaviors.
Move STOP related unit tests in their own test file and add new tests to cover this change.
Differential Revision: https://reviews.llvm.org/D114152
show more ...
|
#
4a0af824 |
| 10-Nov-2021 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Respect NO_STOP_MESSAGE=1 in runtime
When an environment variable NO_STOP_MESSAGE=1 is set, assume that STOP statements with a successful code have QUIET=.TRUE.
Differential Revision: https
[flang] Respect NO_STOP_MESSAGE=1 in runtime
When an environment variable NO_STOP_MESSAGE=1 is set, assume that STOP statements with a successful code have QUIET=.TRUE.
Differential Revision: https://reviews.llvm.org/D113701
show more ...
|
#
faa18428 |
| 23-Sep-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] Front-end and runtime support for CALL EXIT and ABORT
Support the extension intrinsic subroutines EXIT([status]) and ABORT() in the intrinsic table and runtime support library. Lowering rem
[flang] Front-end and runtime support for CALL EXIT and ABORT
Support the extension intrinsic subroutines EXIT([status]) and ABORT() in the intrinsic table and runtime support library. Lowering remains to be done.
Differential Revision: https://reviews.llvm.org/D110741
show more ...
|
#
830c0b90 |
| 01-Sep-2021 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Move runtime API headers to flang/include/flang/Runtime
Move the closure of the subset of flang/runtime/*.h header files that are referenced by source files outside flang/runtime (apart from
[flang] Move runtime API headers to flang/include/flang/Runtime
Move the closure of the subset of flang/runtime/*.h header files that are referenced by source files outside flang/runtime (apart from unit tests) into a new directory (flang/include/flang/Runtime) so that relative include paths into ../runtime need not be used.
flang/runtime/pgmath.h.inc is moved to flang/include/flang/Evaluate; it's not used by the runtime.
Differential Revision: https://reviews.llvm.org/D109107
show more ...
|
#
651f58bf |
| 02-Sep-2021 |
Diana Picus <diana.picus@linaro.org> |
[flang] Remove *- C++ -* incantation from runtime .cpp files. NFC
We should only need to spell the language out in .h files.
Differential Revision: https://reviews.llvm.org/D109138
|
#
3261aefc |
| 01-Oct-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Extend runtime API for PAUSE to allow a stop code
Support integer and default character stop codes on PAUSE statements. Add length argument to STOP statement with a character stop code.
Di
[flang] Extend runtime API for PAUSE to allow a stop code
Support integer and default character stop codes on PAUSE statements. Add length argument to STOP statement with a character stop code.
Differential revision: https://reviews.llvm.org/D88692
show more ...
|
#
cbff0c75 |
| 17-Jul-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Improve output from a STOP statement
Add a missing newline to IEEE FP flag formatting, and don't neglect to emit STOP when there's no code number.
Reviewed By: tskeith
Differential Revisio
[flang] Improve output from a STOP statement
Add a missing newline to IEEE FP flag formatting, and don't neglect to emit STOP when there's no code number.
Reviewed By: tskeith
Differential Revision: https://reviews.llvm.org/D84060
show more ...
|
#
5d5b9682 |
| 04-Jul-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Add fixes and missing stmts to I/O runtime API handlers (ext. I/O part 8)
Complete the rework of the initial implementation of external I/O to fix problems found in testing (tests to follow)
[flang] Add fixes and missing stmts to I/O runtime API handlers (ext. I/O part 8)
Complete the rework of the initial implementation of external I/O to fix problems found in testing (tests to follow); add handlers for hitherto unimplemented PAUSE, FLUSH, ENDFILE, BACKSPACE, and REWIND statements.
Reviewed By: tskeith, sscalpone
Differential Revision: https://reviews.llvm.org/D83162
show more ...
|
#
27505565 |
| 18-Jun-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Roll up small fixes to runtime bugs found in testing
Summary: Fix several bugs in the Fortran runtime found in initial testing.
Reviewers: tskeith, PeteSteinfeld, sscalpone, jdoerfert, Davi
[flang] Roll up small fixes to runtime bugs found in testing
Summary: Fix several bugs in the Fortran runtime found in initial testing.
Reviewers: tskeith, PeteSteinfeld, sscalpone, jdoerfert, DavidTruby
Reviewed By: tskeith, PeteSteinfeld
Subscribers: llvm-commits, flang-commits
Tags: #flang, #llvm
Differential Revision: https://reviews.llvm.org/D82116
show more ...
|
#
1f879005 |
| 29-Mar-2020 |
Tim Keith <tkeith@nvidia.com> |
[flang] Reformat with latest clang-format and .clang-format
Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094
|
#
95696d56 |
| 05-Feb-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Progress on Fortran I/O runtime
Use internal units for internal I/O state
Replace use of virtual functions
reference_wrapper
Internal formatted output to array descriptor
Delete dead cod
[flang] Progress on Fortran I/O runtime
Use internal units for internal I/O state
Replace use of virtual functions
reference_wrapper
Internal formatted output to array descriptor
Delete dead code
Begin list-directed internal output
Refactorings and renamings for clarity
List-directed external I/O (character)
COMPLEX list-directed output
Control list items
First cut at unformatted I/O
More OPEN statement work; rename class to ExternalFileUnit
Complete OPEN (exc. for POSITION=), add CLOSE()
OPEN(POSITION=)
Flush buffers on crash and for terminal output; clean up
Documentation
Fix backquote in documentation
Fix typo in comment
Begin implementation of input
Refactor binary floating-point properties to a new header, simplify numeric output editing
Dodge spurious GCC 7.2 build warning
Address review comments
Original-commit: flang-compiler/f18@9c4bba11cf2329575ea9ee446f69e9caa797135c Reviewed-on: https://github.com/flang-compiler/f18/pull/982
show more ...
|
#
f7be2518 |
| 24-Jan-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Initial buffer framing code
Address review comments
Integer output data editing (I,B,O,Z)
Full integer output formatting
Stub out some work in progress
Progress on E output data editing
[flang] Initial buffer framing code
Address review comments
Integer output data editing (I,B,O,Z)
Full integer output formatting
Stub out some work in progress
Progress on E output data editing
E, D, EN, and ES output editing done
Fw.d output editing
Real G output editing
G output editing for reals
Make environment a distinct module
CHARACTER and LOGICAL output editing
Minimal decimal representations for E0, F0, G0 editing
Move real output editing code into its own file
Fix/dodge some GCC build problems
Prep work for external I/O statement state
External HELLO, WORLD
Fix build problem with GCC
Add virtual destructors where needed
Add new test
Original-commit: flang-compiler/f18@c3f1774f8eee903928b7e46636edfb03425eabc0 Reviewed-on: https://github.com/flang-compiler/f18/pull/950
show more ...
|
#
352d347a |
| 28-Jan-2020 |
Alexis Perry <AlexisPerry@users.noreply.github.com> |
[flang] Changed *.cc file extension to *.cpp (updated scripts) (flang-compiler/f18#958)
Updated CMake files accordingly, using better regex
Updated license headers to match new extension and fit wi
[flang] Changed *.cc file extension to *.cpp (updated scripts) (flang-compiler/f18#958)
Updated CMake files accordingly, using better regex
Updated license headers to match new extension and fit within 80 columns
Updated other comments within files that referred to the old extension
Original-commit: flang-compiler/f18@ae7721e611918631d1e3821dbb60f5ffcd9a69b1 Reviewed-on: https://github.com/flang-compiler/f18/pull/958
show more ...
|