gcc/libgcc
Thomas Schwinge 199f1abeef nvptx: Support '-mfake-ptx-alloca': defer failure to run-time 'alloca' usage
Follow-up to commit 1146410c0f
"nvptx: Support '-mfake-ptx-alloca'".  '-mfake-ptx-alloca' is applicable only
for configurations where PTX 'alloca' is not supported, where target libraries
are built with it enabled (that is, libstdc++, libgfortran).

This change progresses:

    [-FAIL:-]{+PASS:+} g++.dg/tree-ssa/pr20458.C  -std=gnu++17 (test for excess errors)
    [-UNRESOLVED:-]{+PASS:+} g++.dg/tree-ssa/pr20458.C  -std=gnu++17 [-compilation failed to produce executable-]{+execution test+}
    [-FAIL:-]{+PASS:+} g++.dg/tree-ssa/pr20458.C  -std=gnu++26 (test for excess errors)
    [-UNRESOLVED:-]{+PASS:+} g++.dg/tree-ssa/pr20458.C  -std=gnu++26 [-compilation failed to produce executable-]{+execution test+}
    UNSUPPORTED: g++.dg/tree-ssa/pr20458.C  -std=gnu++98: exception handling not supported

..., and "enables" a few test cases:

    FAIL: g++.old-deja/g++.other/sibcall1.C  -std=gnu++17 (test for excess errors)
    [Etc.]

    FAIL: g++.old-deja/g++.other/unchanging1.C  -std=gnu++17 (test for excess errors)
    [Etc.]

..., which now (unrelatedly to 'alloca', and in the same way as configurations
where PTX 'alloca' is supported) FAIL due to:

    unresolved symbol _Unwind_DeleteException
    collect2: error: ld returned 1 exit status

Most importantly, it progresses ~830 libstdc++ test cases:

    [-FAIL:-]{+PASS:+} [...] (test for excess errors)

..., with (if applicable, for most of them):

    [-UNRESOLVED:-]{+PASS:+} [...] [-compilation failed to produce executable-]{+execution test+}

..., or just a few 'FAIL: [...] execution test' where these test cases also
FAIL in configurations where PTX 'alloca' is supported, or ~120 instances of
'FAIL: [...]  execution test' due to run-time
'GCC/nvptx: sorry, unimplemented: dynamic stack allocation not supported'.

This change also resolves the cases noted in
commit bac2d8a246
"nvptx: Build libgfortran with '-mfake-ptx-alloca' [PR107635]":

| With '-mfake-ptx-alloca', libgfortran again succeeds to build, and compared
| to before, we've got only a small number of regressions due to nvptx 'ld'
| complaining about 'unresolved symbol __GCC_nvptx__PTX_alloca_not_supported':
|
|     [-PASS:-]{+FAIL:+} gfortran.dg/coarray/codimension_2.f90 -fcoarray=lib  -O2  -lcaf_single (test for excess errors)

    [-FAIL:-]{+PASS:+} gfortran.dg/coarray/codimension_2.f90 -fcoarray=lib  -O2  -lcaf_single (test for excess errors)

|     [-PASS:-]{+FAIL:+} gfortran.dg/coarray/event_4.f08 -fcoarray=lib  -O2  -lcaf_single (test for excess errors)
|     [-PASS:-]{+UNRESOLVED:+} gfortran.dg/coarray/event_4.f08 -fcoarray=lib  -O2  -lcaf_single [-execution test-]{+compilation failed to produce executable+}

    [-FAIL:-]{+PASS:+} gfortran.dg/coarray/event_4.f08 -fcoarray=lib  -O2  -lcaf_single (test for excess errors)
    [-UNRESOLVED:-]{+PASS:+} gfortran.dg/coarray/event_4.f08 -fcoarray=lib  -O2  -lcaf_single [-compilation failed to produce executable-]{+execution test+}

|     [-PASS:-]{+FAIL:+} gfortran.dg/coarray/fail_image_2.f08 -fcoarray=lib  -O2  -lcaf_single (test for excess errors)
|     [-PASS:-]{+UNRESOLVED:+} gfortran.dg/coarray/fail_image_2.f08 -fcoarray=lib  -O2  -lcaf_single [-execution test-]{+compilation failed to produce executable+}

    [-FAIL:-]{+PASS:+} gfortran.dg/coarray/fail_image_2.f08 -fcoarray=lib  -O2  -lcaf_single (test for excess errors)
    [-UNRESOLVED:-]{+PASS:+} gfortran.dg/coarray/fail_image_2.f08 -fcoarray=lib  -O2  -lcaf_single [-compilation failed to produce executable-]{+execution test+}

|     [-PASS:-]{+FAIL:+} gfortran.dg/coarray/proc_pointer_assign_1.f90 -fcoarray=lib  -O2  -lcaf_single (test for excess errors)
|     [-PASS:-]{+UNRESOLVED:+} gfortran.dg/coarray/proc_pointer_assign_1.f90 -fcoarray=lib  -O2  -lcaf_single [-execution test-]{+compilation failed to produce executable+}

    [-FAIL:-]{+PASS:+} gfortran.dg/coarray/proc_pointer_assign_1.f90 -fcoarray=lib  -O2  -lcaf_single (test for excess errors)
    [-UNRESOLVED:-]{+PASS:+} gfortran.dg/coarray/proc_pointer_assign_1.f90 -fcoarray=lib  -O2  -lcaf_single [-compilation failed to produce executable-]{+execution test+}

|     [-PASS:-]{+FAIL:+} gfortran.dg/coarray_43.f90   -O  (test for excess errors)

    [-FAIL:-]{+PASS:+} gfortran.dg/coarray_43.f90   -O  (test for excess errors)

..., and further progresses:

    [-FAIL:-]{+PASS:+} gfortran.dg/coarray_lib_comm_1.f90   -O0  (test for excess errors)
    [-UNRESOLVED:-]{+FAIL:+} gfortran.dg/coarray_lib_comm_1.f90   -O0  [-compilation failed to produce executable-]{+execution test+}
    [Etc.]

..., which now (unrelatedly to 'alloca', and in the same way as configurations
where PTX 'alloca' is supported) FAILs due to:

    error   : Prototype doesn't match for '_gfortran_caf_transfer_between_remotes' in 'input file 9 at offset 159897', first defined in 'input file 9 at offset 159897'
    error   : Prototype doesn't match for '_gfortran_caf_stop_numeric' in 'input file 9 at offset 159897', first defined in 'input file 9 at offset 159897'
    nvptx-run: cuLinkAddData failed: device kernel image is invalid (CUDA_ERROR_INVALID_SOURCE, 300)

	gcc/
	* config/nvptx/nvptx.opt (-mfake-ptx-alloca): Update.
	gcc/testsuite/
	* gcc.target/nvptx/alloca-2-O0_-mfake-ptx-alloca.c: Adjust.
	libgcc/
	* config/nvptx/alloca.c: New.
	* config/nvptx/t-nvptx (LIB2ADD): Add it.
2025-04-07 15:57:02 +02:00
..
config nvptx: Support '-mfake-ptx-alloca': defer failure to run-time 'alloca' usage 2025-04-07 15:57:02 +02:00
soft-fp [RISC-V] Add support for _Bfloat16 2024-05-06 15:39:12 -06:00
ChangeLog Daily bump. 2025-04-07 00:16:32 +00:00
config.host libgcc: On FreeBSD use GCC's crt objects for static linking 2025-02-08 17:36:36 +01:00
config.in Remove obsolete Solaris 11.3 support 2024-05-07 10:45:55 +02:00
configure openmp: Add crtoffloadtableS.o and use it [PR117851] 2024-11-30 11:19:12 +01:00
configure.ac openmp: Add crtoffloadtableS.o and use it [PR117851] 2024-11-30 11:19:12 +01:00
crtstuff.c Update copyright years. 2025-01-02 11:59:57 +01:00
dfp-bit.c Update copyright years. 2025-01-02 11:59:57 +01:00
dfp-bit.h Update copyright years. 2025-01-02 11:59:57 +01:00
divmod.c Update copyright years. 2025-01-02 11:59:57 +01:00
emutls.c Update copyright years. 2025-01-02 11:59:57 +01:00
enable-execute-stack-empty.c
enable-execute-stack-mprotect.c Update copyright years. 2025-01-02 11:59:57 +01:00
find-symver.awk Update copyright years. 2025-01-02 11:59:57 +01:00
fixed-bit.c Update copyright years. 2025-01-02 11:59:57 +01:00
fixed-bit.h Update copyright years. 2025-01-02 11:59:57 +01:00
fixed-obj.mk
floatunsidf.c
floatunsisf.c
floatunsitf.c
floatunsixf.c
fp-bit.c Update copyright years. 2025-01-02 11:59:57 +01:00
fp-bit.h Update copyright years. 2025-01-02 11:59:57 +01:00
gbl-ctors.h Update copyright years. 2025-01-02 11:59:57 +01:00
gcov.h Update copyright years. 2025-01-02 11:59:57 +01:00
gen-fixed.sh
generic-morestack-thread.c Update copyright years. 2025-01-02 11:59:57 +01:00
generic-morestack.c Update copyright years. 2025-01-02 11:59:57 +01:00
generic-morestack.h Update copyright years. 2025-01-02 11:59:57 +01:00
gstdint.h
gthr-posix.h Update copyright years. 2025-01-02 11:59:57 +01:00
gthr-single.h Update copyright years. 2025-01-02 11:59:57 +01:00
gthr.h Update copyright years. 2025-01-02 11:59:57 +01:00
hardcfr.c Update copyright years. 2025-01-02 11:59:57 +01:00
libgcc-std.ver.in Update copyright years. 2025-01-02 11:59:57 +01:00
libgcc2.c Update copyright years. 2025-01-02 11:59:57 +01:00
libgcc2.h Update copyright years. 2025-01-02 11:59:57 +01:00
libgcov-driver-system.c Update copyright years. 2025-01-02 11:59:57 +01:00
libgcov-driver.c Update copyright years. 2025-01-02 11:59:57 +01:00
libgcov-interface.c Update copyright years. 2025-01-02 11:59:57 +01:00
libgcov-merge.c Update copyright years. 2025-01-02 11:59:57 +01:00
libgcov-profiler.c Update copyright years. 2025-01-02 11:59:57 +01:00
libgcov-util.c Update copyright years. 2025-01-02 11:59:57 +01:00
libgcov.h Update copyright years. 2025-01-02 11:59:57 +01:00
Makefile.in Update copyright years. 2025-01-02 11:59:57 +01:00
memcmp.c
memcpy.c
memmove.c
memset.c
mkheader.sh Update copyright years. 2025-01-02 11:59:57 +01:00
mkmap-flat.awk Update copyright years. 2025-01-02 11:59:57 +01:00
mkmap-symver.awk Update copyright years. 2025-01-02 11:59:57 +01:00
offloadstuff.c Update copyright years. 2025-01-02 11:59:57 +01:00
shared-object.mk
siditi-object.mk
static-object.mk
strub.c Update copyright years. 2025-01-02 11:59:57 +01:00
sync.c Update copyright years. 2025-01-02 11:59:57 +01:00
udivhi3.c Update copyright years. 2025-01-02 11:59:57 +01:00
udivmod.c Update copyright years. 2025-01-02 11:59:57 +01:00
udivmodhi4.c Update copyright years. 2025-01-02 11:59:57 +01:00
udivmodsi4.c Update copyright years. 2025-01-02 11:59:57 +01:00
unwind-arm-common.inc Update copyright years. 2025-01-02 11:59:57 +01:00
unwind-c.c Update copyright years. 2025-01-02 11:59:57 +01:00
unwind-compat.c Update copyright years. 2025-01-02 11:59:57 +01:00
unwind-compat.h Update copyright years. 2025-01-02 11:59:57 +01:00
unwind-dw2-btree.h libgcc: Fix up unwind-dw2-btree.h [PR119151] 2025-03-10 10:35:29 +01:00
unwind-dw2-execute_cfa.h Update copyright years. 2025-01-02 11:59:57 +01:00
unwind-dw2-fde-compat.c Update copyright years. 2025-01-02 11:59:57 +01:00
unwind-dw2-fde-dip.c Update copyright years. 2025-01-02 11:59:57 +01:00
unwind-dw2-fde.c Update copyright years. 2025-01-02 11:59:57 +01:00
unwind-dw2-fde.h Update copyright years. 2025-01-02 11:59:57 +01:00
unwind-dw2.c Update copyright years. 2025-01-02 11:59:57 +01:00
unwind-dw2.h Update copyright years. 2025-01-02 11:59:57 +01:00
unwind-generic.h Update copyright years. 2025-01-02 11:59:57 +01:00
unwind-pe.h Update copyright years. 2025-01-02 11:59:57 +01:00
unwind-seh.c Update copyright years. 2025-01-02 11:59:57 +01:00
unwind-sjlj.c Update copyright years. 2025-01-02 11:59:57 +01:00
unwind.inc Update copyright years. 2025-01-02 11:59:57 +01:00
vtv_end.c Update copyright years. 2025-01-02 11:59:57 +01:00
vtv_end_preinit.c Update copyright years. 2025-01-02 11:59:57 +01:00
vtv_start.c Update copyright years. 2025-01-02 11:59:57 +01:00
vtv_start_preinit.c Update copyright years. 2025-01-02 11:59:57 +01:00