]> git.ipfire.org Git - thirdparty/gcc.git/commit
strub: enable conditional support
authorAlexandre Oliva <oliva@adacore.com>
Thu, 7 Dec 2023 15:58:20 +0000 (12:58 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Thu, 7 Dec 2023 15:58:20 +0000 (12:58 -0300)
commitf908368d2cb50b26c4557df6b37bc13a3723ef49
tree55e731d0ec6fbd367e892aedc035f4847bf00674
parentd36cac18724a63b1dbcbe722015232c72214ce93
strub: enable conditional support

Targets that don't expose callee stacks to callers, such as nvptx, as
well as -fsplit-stack compilations, violate fundamental assumptions of
the current strub implementation.  This patch enables targets to
disable strub, and disables it when -fsplit-stack is enabled.

When strub support is disabled, the testsuite will now skip strub
tests, and libgcc will not build the strub runtime components.

for  gcc/ChangeLog

* target.def (have_strub_support_for): New hook.
* doc/tm.texi.in: Document it.
* doc/tm.texi: Rebuild.
* ipa-strub.cc: Include target.h.
(strub_target_support_p): New.
(can_strub_p): Call it.  Test for no flag_split_stack.
(pass_ipa_strub::adjust_at_calls_call): Check for target
support.
* config/nvptx/nvptx.cc (TARGET_HAVE_STRUB_SUPPORT_FOR):
Disable.
* doc/sourcebuild.texi (strub): Document new effective
target.

for  gcc/testsuite/ChangeLog

* c-c++-common/strub-split-stack.c: New.
* c-c++-common/strub-unsupported.c: New.
* c-c++-common/strub-unsupported-2.c: New.
* c-c++-common/strub-unsupported-3.c: New.
* lib/target-supports.exp (check_effective_target_strub): New.
* c-c++-common/strub-O0.c: Require effective target strub.
* c-c++-common/strub-O1.c: Likewise.
* c-c++-common/strub-O2.c: Likewise.
* c-c++-common/strub-O2fni.c: Likewise.
* c-c++-common/strub-O3.c: Likewise.
* c-c++-common/strub-O3fni.c: Likewise.
* c-c++-common/strub-Og.c: Likewise.
* c-c++-common/strub-Os.c: Likewise.
* c-c++-common/strub-all1.c: Likewise.
* c-c++-common/strub-all2.c: Likewise.
* c-c++-common/strub-apply1.c: Likewise.
* c-c++-common/strub-apply2.c: Likewise.
* c-c++-common/strub-apply3.c: Likewise.
* c-c++-common/strub-apply4.c: Likewise.
* c-c++-common/strub-at-calls1.c: Likewise.
* c-c++-common/strub-at-calls2.c: Likewise.
* c-c++-common/strub-defer-O1.c: Likewise.
* c-c++-common/strub-defer-O2.c: Likewise.
* c-c++-common/strub-defer-O3.c: Likewise.
* c-c++-common/strub-defer-Os.c: Likewise.
* c-c++-common/strub-internal1.c: Likewise.
* c-c++-common/strub-internal2.c: Likewise.
* c-c++-common/strub-parms1.c: Likewise.
* c-c++-common/strub-parms2.c: Likewise.
* c-c++-common/strub-parms3.c: Likewise.
* c-c++-common/strub-relaxed1.c: Likewise.
* c-c++-common/strub-relaxed2.c: Likewise.
* c-c++-common/strub-short-O0-exc.c: Likewise.
* c-c++-common/strub-short-O0.c: Likewise.
* c-c++-common/strub-short-O1.c: Likewise.
* c-c++-common/strub-short-O2.c: Likewise.
* c-c++-common/strub-short-O3.c: Likewise.
* c-c++-common/strub-short-Os.c: Likewise.
* c-c++-common/strub-strict1.c: Likewise.
* c-c++-common/strub-strict2.c: Likewise.
* c-c++-common/strub-tail-O1.c: Likewise.
* c-c++-common/strub-tail-O2.c: Likewise.
* c-c++-common/strub-var1.c: Likewise.
* c-c++-common/torture/strub-callable1.c: Likewise.
* c-c++-common/torture/strub-callable2.c: Likewise.
* c-c++-common/torture/strub-const1.c: Likewise.
* c-c++-common/torture/strub-const2.c: Likewise.
* c-c++-common/torture/strub-const3.c: Likewise.
* c-c++-common/torture/strub-const4.c: Likewise.
* c-c++-common/torture/strub-data1.c: Likewise.
* c-c++-common/torture/strub-data2.c: Likewise.
* c-c++-common/torture/strub-data3.c: Likewise.
* c-c++-common/torture/strub-data4.c: Likewise.
* c-c++-common/torture/strub-data5.c: Likewise.
* c-c++-common/torture/strub-indcall1.c: Likewise.
* c-c++-common/torture/strub-indcall2.c: Likewise.
* c-c++-common/torture/strub-indcall3.c: Likewise.
* c-c++-common/torture/strub-inlinable1.c: Likewise.
* c-c++-common/torture/strub-inlinable2.c: Likewise.
* c-c++-common/torture/strub-ptrfn1.c: Likewise.
* c-c++-common/torture/strub-ptrfn2.c: Likewise.
* c-c++-common/torture/strub-ptrfn3.c: Likewise.
* c-c++-common/torture/strub-ptrfn4.c: Likewise.
* c-c++-common/torture/strub-pure1.c: Likewise.
* c-c++-common/torture/strub-pure2.c: Likewise.
* c-c++-common/torture/strub-pure3.c: Likewise.
* c-c++-common/torture/strub-pure4.c: Likewise.
* c-c++-common/torture/strub-run1.c: Likewise.
* c-c++-common/torture/strub-run2.c: Likewise.
* c-c++-common/torture/strub-run3.c: Likewise.
* c-c++-common/torture/strub-run4.c: Likewise.
* c-c++-common/torture/strub-run4c.c: Likewise.
* c-c++-common/torture/strub-run4d.c: Likewise.
* c-c++-common/torture/strub-run4i.c: Likewise.
* g++.dg/strub-run1.C: Likewise.
* g++.dg/torture/strub-init1.C: Likewise.
* g++.dg/torture/strub-init2.C: Likewise.
* g++.dg/torture/strub-init3.C: Likewise.
* gnat.dg/strub_attr.adb: Likewise.
* gnat.dg/strub_ind.adb: Likewise.
* gnat.dg/strub_access.adb: Likewise.
* gnat.dg/strub_access1.adb: Likewise.
* gnat.dg/strub_disp.adb: Likewise.
* gnat.dg/strub_disp1.adb: Likewise.
* gnat.dg/strub_ind1.adb: Likewise.
* gnat.dg/strub_ind2.adb: Likewise.
* gnat.dg/strub_intf.adb: Likewise.
* gnat.dg/strub_intf1.adb: Likewise.
* gnat.dg/strub_intf2.adb: Likewise.
* gnat.dg/strub_renm.adb: Likewise.
* gnat.dg/strub_renm1.adb: Likewise.
* gnat.dg/strub_renm2.adb: Likewise.
* gnat.dg/strub_var.adb: Likewise.
* gnat.dg/strub_var1.adb: Likewise.

for  libgcc/ChangeLog

* configure.ac: Check for strub support.
* configure: Rebuilt.
* Makefile.in: Compile strub.c conditionally.
103 files changed:
gcc/config/nvptx/nvptx.cc
gcc/doc/sourcebuild.texi
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/ipa-strub.cc
gcc/target.def
gcc/testsuite/c-c++-common/strub-O0.c
gcc/testsuite/c-c++-common/strub-O1.c
gcc/testsuite/c-c++-common/strub-O2.c
gcc/testsuite/c-c++-common/strub-O2fni.c
gcc/testsuite/c-c++-common/strub-O3.c
gcc/testsuite/c-c++-common/strub-O3fni.c
gcc/testsuite/c-c++-common/strub-Og.c
gcc/testsuite/c-c++-common/strub-Os.c
gcc/testsuite/c-c++-common/strub-all1.c
gcc/testsuite/c-c++-common/strub-all2.c
gcc/testsuite/c-c++-common/strub-apply1.c
gcc/testsuite/c-c++-common/strub-apply2.c
gcc/testsuite/c-c++-common/strub-apply3.c
gcc/testsuite/c-c++-common/strub-apply4.c
gcc/testsuite/c-c++-common/strub-at-calls1.c
gcc/testsuite/c-c++-common/strub-at-calls2.c
gcc/testsuite/c-c++-common/strub-defer-O1.c
gcc/testsuite/c-c++-common/strub-defer-O2.c
gcc/testsuite/c-c++-common/strub-defer-O3.c
gcc/testsuite/c-c++-common/strub-defer-Os.c
gcc/testsuite/c-c++-common/strub-internal1.c
gcc/testsuite/c-c++-common/strub-internal2.c
gcc/testsuite/c-c++-common/strub-parms1.c
gcc/testsuite/c-c++-common/strub-parms2.c
gcc/testsuite/c-c++-common/strub-parms3.c
gcc/testsuite/c-c++-common/strub-relaxed1.c
gcc/testsuite/c-c++-common/strub-relaxed2.c
gcc/testsuite/c-c++-common/strub-short-O0-exc.c
gcc/testsuite/c-c++-common/strub-short-O0.c
gcc/testsuite/c-c++-common/strub-short-O1.c
gcc/testsuite/c-c++-common/strub-short-O2.c
gcc/testsuite/c-c++-common/strub-short-O3.c
gcc/testsuite/c-c++-common/strub-short-Os.c
gcc/testsuite/c-c++-common/strub-split-stack.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/strub-strict1.c
gcc/testsuite/c-c++-common/strub-strict2.c
gcc/testsuite/c-c++-common/strub-tail-O1.c
gcc/testsuite/c-c++-common/strub-tail-O2.c
gcc/testsuite/c-c++-common/strub-unsupported-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/strub-unsupported-3.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/strub-unsupported.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/strub-var1.c
gcc/testsuite/c-c++-common/torture/strub-callable1.c
gcc/testsuite/c-c++-common/torture/strub-callable2.c
gcc/testsuite/c-c++-common/torture/strub-const1.c
gcc/testsuite/c-c++-common/torture/strub-const2.c
gcc/testsuite/c-c++-common/torture/strub-const3.c
gcc/testsuite/c-c++-common/torture/strub-const4.c
gcc/testsuite/c-c++-common/torture/strub-data1.c
gcc/testsuite/c-c++-common/torture/strub-data2.c
gcc/testsuite/c-c++-common/torture/strub-data3.c
gcc/testsuite/c-c++-common/torture/strub-data4.c
gcc/testsuite/c-c++-common/torture/strub-data5.c
gcc/testsuite/c-c++-common/torture/strub-indcall1.c
gcc/testsuite/c-c++-common/torture/strub-indcall2.c
gcc/testsuite/c-c++-common/torture/strub-indcall3.c
gcc/testsuite/c-c++-common/torture/strub-inlinable1.c
gcc/testsuite/c-c++-common/torture/strub-inlinable2.c
gcc/testsuite/c-c++-common/torture/strub-ptrfn1.c
gcc/testsuite/c-c++-common/torture/strub-ptrfn2.c
gcc/testsuite/c-c++-common/torture/strub-ptrfn3.c
gcc/testsuite/c-c++-common/torture/strub-ptrfn4.c
gcc/testsuite/c-c++-common/torture/strub-pure1.c
gcc/testsuite/c-c++-common/torture/strub-pure2.c
gcc/testsuite/c-c++-common/torture/strub-pure3.c
gcc/testsuite/c-c++-common/torture/strub-pure4.c
gcc/testsuite/c-c++-common/torture/strub-run1.c
gcc/testsuite/c-c++-common/torture/strub-run2.c
gcc/testsuite/c-c++-common/torture/strub-run3.c
gcc/testsuite/c-c++-common/torture/strub-run4.c
gcc/testsuite/c-c++-common/torture/strub-run4c.c
gcc/testsuite/c-c++-common/torture/strub-run4d.c
gcc/testsuite/c-c++-common/torture/strub-run4i.c
gcc/testsuite/g++.dg/strub-run1.C
gcc/testsuite/g++.dg/torture/strub-init1.C
gcc/testsuite/g++.dg/torture/strub-init2.C
gcc/testsuite/g++.dg/torture/strub-init3.C
gcc/testsuite/gnat.dg/strub_access.adb
gcc/testsuite/gnat.dg/strub_access1.adb
gcc/testsuite/gnat.dg/strub_attr.adb
gcc/testsuite/gnat.dg/strub_disp.adb
gcc/testsuite/gnat.dg/strub_disp1.adb
gcc/testsuite/gnat.dg/strub_ind.adb
gcc/testsuite/gnat.dg/strub_ind1.adb
gcc/testsuite/gnat.dg/strub_ind2.adb
gcc/testsuite/gnat.dg/strub_intf.adb
gcc/testsuite/gnat.dg/strub_intf1.adb
gcc/testsuite/gnat.dg/strub_intf2.adb
gcc/testsuite/gnat.dg/strub_renm.adb
gcc/testsuite/gnat.dg/strub_renm1.adb
gcc/testsuite/gnat.dg/strub_renm2.adb
gcc/testsuite/gnat.dg/strub_var.adb
gcc/testsuite/gnat.dg/strub_var1.adb
gcc/testsuite/lib/target-supports.exp
libgcc/Makefile.in
libgcc/configure
libgcc/configure.ac