aboutsummaryrefslogtreecommitdiff
path: root/gcc/json-parsing.cc
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2025-02-24 16:13:11 +0100
committerThomas Schwinge <tschwinge@baylibre.com>2025-02-27 21:48:15 +0100
commit1146410c0feb0e82c689b1333fdf530a2b34dc2b (patch)
tree4016d7fb1339de238efc794e0ed6e999bb610193 /gcc/json-parsing.cc
parent22e76700aea63eb8c298403bb2e717a6a4fc9c1e (diff)
downloadgcc-1146410c0feb0e82c689b1333fdf530a2b34dc2b.zip
gcc-1146410c0feb0e82c689b1333fdf530a2b34dc2b.tar.gz
gcc-1146410c0feb0e82c689b1333fdf530a2b34dc2b.tar.bz2
nvptx: Support '-mfake-ptx-alloca'
With '-mfake-ptx-alloca' enabled, the user-visible behavior changes only for configurations where PTX 'alloca' is not available. Rather than a compile-time 'sorry, unimplemented: dynamic stack allocation not supported' in presence of dynamic stack allocation, compilation and assembly then succeeds. However, attempting to link in such '*.o' files then fails due to unresolved symbol '__GCC_nvptx__PTX_alloca_not_supported'. This is meant to be used in scenarios where large volumes of code are compiled, a small fraction of which runs into dynamic stack allocation, but these parts are not important for specific use cases, and we'd thus like the build to succeed, and error out just upon actual, very rare use of the offending '*.o' files. gcc/ * config/nvptx/nvptx.opt (-mfake-ptx-alloca): New. * config/nvptx/nvptx-protos.h (nvptx_output_fake_ptx_alloca): Declare. * config/nvptx/nvptx.cc (nvptx_output_fake_ptx_alloca): New. * config/nvptx/nvptx.md (define_insn "@nvptx_alloca_<mode>") [!(TARGET_PTX_7_3 && TARGET_SM52)]: Use it for '-mfake-ptx-alloca'. gcc/testsuite/ * gcc.target/nvptx/alloca-1-O0_-mfake-ptx-alloca.c: New. * gcc.target/nvptx/alloca-2-O0_-mfake-ptx-alloca.c: Likewise. * gcc.target/nvptx/alloca-4-O3_-mfake-ptx-alloca.c: Likewise. * gcc.target/nvptx/vla-1-O0_-mfake-ptx-alloca.c: Likewise. * gcc.target/nvptx/alloca-4-O3.c: 'dg-additional-options -mfake-ptx-alloca'.
Diffstat (limited to 'gcc/json-parsing.cc')
0 files changed, 0 insertions, 0 deletions