]> git.ipfire.org Git - thirdparty/gcc.git/commit
Avoid SIGSEGV in nvptx 'mkoffload' for voluminous PTX code
authorThomas Schwinge <tschwinge@baylibre.com>
Mon, 26 May 2025 11:31:54 +0000 (13:31 +0200)
committerThomas Schwinge <tschwinge@baylibre.com>
Wed, 4 Jun 2025 17:17:48 +0000 (19:17 +0200)
commit01044e0ee27093a3990996578b15f6ab69ed3395
tree37db9525fe4d1376a7432a1e9dd8e10e52ad3e23
parent069caa5cea91fab3f1579ee1fdf50b923b75a6de
Avoid SIGSEGV in nvptx 'mkoffload' for voluminous PTX code

In commit 50be486dff4ea2676ed022e9524ef190b92ae2b1
"nvptx: libgomp+mkoffload.cc: Prepare for reverse offload fn lookup", some
additional tracking of the PTX code was added, and this assumes that
potentially every single character of PTX code needs to be tracked as a new
chunk of PTX code.  That's problematic if we're dealing with voluminous PTX
code (for example, non-trivial C++ code), and the 'file_idx' 'alloca'tion then
causes stack overflow.  For example:

    FAIL: libgomp.c++/target-std__valarray-1.C (test for excess errors)
    UNRESOLVED: libgomp.c++/target-std__valarray-1.C compilation failed to produce executable

    lto-wrapper: fatal error: [...]/build-gcc/gcc//accel/nvptx-none/mkoffload terminated with signal 11 [Segmentation fault], core dumped

gcc/
* config/nvptx/mkoffload.cc (process): Use an 'auto_vec' for
'file_idx'.
gcc/config/nvptx/mkoffload.cc