From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 10BF4385828B; Fri, 4 Nov 2022 09:02:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10BF4385828B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667552556; bh=VEIgTLlvTc9j5ODEDlBSgtbCC24yz6NqIg3Xhs+/fQ0=; h=From:To:Subject:Date:From; b=MSWfmEHIiHFTJPz4954TbvooFNGXpxin/79fnoOCNsAS/Qh3llKtXHFo90XjlopYY U++puynm1SOVTSL2msZRItM/cTJKMOtzHPCltDD0glo3KoQdE45qRfUzNbGf265+VV iRa3wOLmV2e4B/kLE4j3AaJSWExKLs9DLFOmgB6g= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3650] Better integrate default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR' X-Act-Checkin: gcc X-Git-Author: Thomas Schwinge X-Git-Refname: refs/heads/master X-Git-Oldrev: 4ee35c11fd328728c12f3e086ae016ca94624bf8 X-Git-Newrev: a05d8e1d15ea08526639ba154e59b6822b704f4c Message-Id: <20221104090236.10BF4385828B@sourceware.org> Date: Fri, 4 Nov 2022 09:02:36 +0000 (GMT) List-Id: https://gcc.gnu.org/g:a05d8e1d15ea08526639ba154e59b6822b704f4c commit r13-3650-ga05d8e1d15ea08526639ba154e59b6822b704f4c Author: Thomas Schwinge Date: Thu Nov 3 17:29:13 2022 +0100 Better integrate default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR' ... after commit 4ee35c11fd328728c12f3e086ae016ca94624bf8 "Restore default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR'". No functional change. gcc/ * Makefile.in (OBJS): Remove 'dbxout.o'. * config/nvptx/nvptx.cc: Don't '#include "dbxout.h"'. * dbxout.cc: Remove. * dbxout.h: Likewise. * target-def.h (TARGET_ASM_CONSTRUCTOR, TARGET_ASM_DESTRUCTOR): Default to 'default_asm_out_constructor', 'default_asm_out_destructor'. * targhooks.cc (default_asm_out_constructor) (default_asm_out_destructor): New. * targhooks.h (default_asm_out_constructor) (default_asm_out_destructor): Declare. Diff: --- gcc/Makefile.in | 1 - gcc/config/nvptx/nvptx.cc | 1 - gcc/dbxout.cc | 43 ------------------------------------------- gcc/dbxout.h | 25 ------------------------- gcc/target-def.h | 4 ++-- gcc/targhooks.cc | 20 ++++++++++++++++++++ gcc/targhooks.h | 2 ++ 7 files changed, 24 insertions(+), 72 deletions(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index c4072d06a93..f672e6ea549 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1355,7 +1355,6 @@ OBJS = \ data-streamer.o \ data-streamer-in.o \ data-streamer-out.o \ - dbxout.o \ dbgcnt.o \ dce.o \ ddg.o \ diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc index 4cb5d02d40c..2fe120b3873 100644 --- a/gcc/config/nvptx/nvptx.cc +++ b/gcc/config/nvptx/nvptx.cc @@ -52,7 +52,6 @@ #include "tm-preds.h" #include "tm-constrs.h" #include "langhooks.h" -#include "dbxout.h" #include "cfgrtl.h" #include "gimple.h" #include "stor-layout.h" diff --git a/gcc/dbxout.cc b/gcc/dbxout.cc deleted file mode 100644 index 161eeb19653..00000000000 --- a/gcc/dbxout.cc +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 1987-2022 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 3, or (at your option) any later -version. - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING3. If not see -. */ - -#include "config.h" -#include "system.h" -#include "coretypes.h" -#include "diagnostic-core.h" -#include "dbxout.h" - -/* Record an element in the table of global destructors. SYMBOL is - a SYMBOL_REF of the function to be called; PRIORITY is a number - between 0 and MAX_INIT_PRIORITY. */ - -void -default_stabs_asm_out_destructor (rtx symbol ATTRIBUTE_UNUSED, - int priority ATTRIBUTE_UNUSED) -{ - sorry ("global destructors not supported on this target"); -} - -/* Likewise for global constructors. */ - -void -default_stabs_asm_out_constructor (rtx symbol ATTRIBUTE_UNUSED, - int priority ATTRIBUTE_UNUSED) -{ - sorry ("global constructors not supported on this target"); -} diff --git a/gcc/dbxout.h b/gcc/dbxout.h deleted file mode 100644 index ad0b538cabf..00000000000 --- a/gcc/dbxout.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 1998-2022 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 3, or (at your option) any later -version. - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING3. If not see -. */ - -#ifndef GCC_DBXOUT_H -#define GCC_DBXOUT_H - -extern void default_stabs_asm_out_destructor (rtx, int); -extern void default_stabs_asm_out_constructor (rtx, int); - -#endif /* GCC_DBXOUT_H */ diff --git a/gcc/target-def.h b/gcc/target-def.h index 1c4aa2963dc..5e5cc3b767e 100644 --- a/gcc/target-def.h +++ b/gcc/target-def.h @@ -63,7 +63,7 @@ # ifdef TARGET_ASM_NAMED_SECTION # define TARGET_ASM_CONSTRUCTOR default_named_section_asm_out_constructor # else -# define TARGET_ASM_CONSTRUCTOR default_stabs_asm_out_constructor +# define TARGET_ASM_CONSTRUCTOR default_asm_out_constructor # endif # endif #endif @@ -75,7 +75,7 @@ # ifdef TARGET_ASM_NAMED_SECTION # define TARGET_ASM_DESTRUCTOR default_named_section_asm_out_destructor # else -# define TARGET_ASM_DESTRUCTOR default_stabs_asm_out_destructor +# define TARGET_ASM_DESTRUCTOR default_asm_out_destructor # endif # endif #endif diff --git a/gcc/targhooks.cc b/gcc/targhooks.cc index d17d393baed..12a58456b39 100644 --- a/gcc/targhooks.cc +++ b/gcc/targhooks.cc @@ -1405,6 +1405,26 @@ default_generate_pic_addr_diff_vec (void) return flag_pic; } +/* Record an element in the table of global constructors. SYMBOL is + a SYMBOL_REF of the function to be called; PRIORITY is a number + between 0 and MAX_INIT_PRIORITY. */ + +void +default_asm_out_constructor (rtx symbol ATTRIBUTE_UNUSED, + int priority ATTRIBUTE_UNUSED) +{ + sorry ("global constructors not supported on this target"); +} + +/* Likewise for global destructors. */ + +void +default_asm_out_destructor (rtx symbol ATTRIBUTE_UNUSED, + int priority ATTRIBUTE_UNUSED) +{ + sorry ("global destructors not supported on this target"); +} + /* By default, do no modification. */ tree default_mangle_decl_assembler_name (tree decl ATTRIBUTE_UNUSED, tree id) diff --git a/gcc/targhooks.h b/gcc/targhooks.h index ecce55ebe79..a6a423c1abb 100644 --- a/gcc/targhooks.h +++ b/gcc/targhooks.h @@ -178,6 +178,8 @@ extern void default_target_option_override (void); extern void hook_void_bitmap (bitmap); extern int default_reloc_rw_mask (void); extern bool default_generate_pic_addr_diff_vec (void); +extern void default_asm_out_constructor (rtx, int); +extern void default_asm_out_destructor (rtx, int); extern tree default_mangle_decl_assembler_name (tree, tree); extern tree default_emutls_var_fields (tree, tree *); extern tree default_emutls_var_init (tree, tree, tree);