aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/nvptx/nvptx.cc
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2022-10-09 22:39:02 +0200
committerThomas Schwinge <thomas@codesourcery.com>2022-11-04 09:59:58 +0100
commit4ee35c11fd328728c12f3e086ae016ca94624bf8 (patch)
treef4b10cd236780751d7cd88f0046b961e8612c34e /gcc/config/nvptx/nvptx.cc
parent2b4a03962a0fe18cadc944d90f1fb85a40004226 (diff)
downloadgcc-4ee35c11fd328728c12f3e086ae016ca94624bf8.zip
gcc-4ee35c11fd328728c12f3e086ae016ca94624bf8.tar.gz
gcc-4ee35c11fd328728c12f3e086ae016ca94624bf8.tar.bz2
Restore default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR'
... that got lost in commit 7e0db0cdf01e9c885a29cb37415f5bc00d90c029 "STABS: remove -gstabs and -gxcoff functionality". Previously, if a back end was not 'USE_COLLECT2', nor manually defined 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR', or got pointed to the respective 'default_[...]' functions due to 'CTORS_SECTION_ASM_OP', 'DTORS_SECTION_ASM_OP', or 'TARGET_ASM_NAMED_SECTION', it got pointed to 'default_stabs_asm_out_constructor', 'default_stabs_asm_out_destructor'. These would emit 'sorry' for any global constructor/destructor they're run into. This is now gone, and thus in such a back end configuration case 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR' don't get defined anymore, and thus the subsequently following: #if !defined(TARGET_HAVE_CTORS_DTORS) # if defined(TARGET_ASM_CONSTRUCTOR) && defined(TARGET_ASM_DESTRUCTOR) # define TARGET_HAVE_CTORS_DTORS true # endif #endif ... doesn't define 'TARGET_HAVE_CTORS_DTORS' anymore, and thus per my understanding, 'gcc/final.cc:rest_of_handle_final': if (DECL_STATIC_CONSTRUCTOR (current_function_decl) && targetm.have_ctors_dtors) targetm.asm_out.constructor (XEXP (DECL_RTL (current_function_decl), 0), decl_init_priority_lookup (current_function_decl)); if (DECL_STATIC_DESTRUCTOR (current_function_decl) && targetm.have_ctors_dtors) targetm.asm_out.destructor (XEXP (DECL_RTL (current_function_decl), 0), decl_fini_priority_lookup (current_function_decl)); ... simply does nothing anymore for a 'DECL_STATIC_CONSTRUCTOR', 'DECL_STATIC_DESTRUCTOR'. This, effectively, means that GCC/nvptx now suddenly appears to "support" global constructors/destructors, which means that a ton of test cases now erroneously PASS that previously used to FAIL: sorry, unimplemented: global constructors not supported on this target Of course, such support didn't magically happen due to "STABS: remove -gstabs and -gxcoff functionality", so this is bad. And, corresponding execution testing then regularly FAILs (due to the global constructor/destructor functions never being invoked), for example: [-UNSUPPORTED:-]{+PASS:+} gcc.dg/initpri1.c {+(test for excess errors)+} {+FAIL: gcc.dg/initpri1.c execution test+} [-UNSUPPORTED:-]{+PASS:+} g++.dg/special/conpr-1.C {+(test for excess errors)+} {+FAIL: g++.dg/special/conpr-1.C execution test+} To restore the previous GCC/nvptx behavior, for traceability, this simply restores the previous code, stripped down to the bare minimum. gcc/ * Makefile.in (OBJS): Add 'dbxout.o'. * config/nvptx/nvptx.cc: '#include "dbxout.h"'. * dbxout.cc: New. * dbxout.h: Likewise. * target-def.h (TARGET_ASM_CONSTRUCTOR, TARGET_ASM_DESTRUCTOR): Default to 'default_stabs_asm_out_constructor', 'default_stabs_asm_out_destructor'.
Diffstat (limited to 'gcc/config/nvptx/nvptx.cc')
-rw-r--r--gcc/config/nvptx/nvptx.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc
index 2fe120b..4cb5d02 100644
--- a/gcc/config/nvptx/nvptx.cc
+++ b/gcc/config/nvptx/nvptx.cc
@@ -52,6 +52,7 @@
#include "tm-preds.h"
#include "tm-constrs.h"
#include "langhooks.h"
+#include "dbxout.h"
#include "cfgrtl.h"
#include "gimple.h"
#include "stor-layout.h"