public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Tom de Vries <tdevries@suse.de>,
	Richard Biener <richard.guenther@gmail.com>,
	<gcc-patches@gcc.gnu.org>
Cc: "Martin Liška" <mliska@suse.cz>
Subject: Better integrate default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR' (was: Restore default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR')
Date: Fri, 4 Nov 2022 10:12:24 +0100	[thread overview]
Message-ID: <87pme32idj.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <CAFiYyc0_miwbZypz7Zcav3QSwP9DN9e_ZycGgp0CuEPKTuEOcw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3690 bytes --]

Hi!

On 2022-10-11T08:40:02+0200, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> On Mon, Oct 10, 2022 at 4:23 PM Tom de Vries <tdevries@suse.de> wrote:
>> FWIW, nvptx change looks in the obvious category to me.

I hadn't put you on CC for approval of the one-line '#include' change,
but rather to inform you about the GCC/nvptx breakage generally.  ;-)


> Can you rename the functions as default_asm_out_* and instead of
> reviving dbxout.cc
> put them into targhooks.cc?

ACK.

Pushed to master branch commit a05d8e1d15ea08526639ba154e59b6822b704f4c
"Better integrate default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR'",
see attached.

With that, the actual 'diff' is simply:

     gcc/target-def.h |  4 ++++
     gcc/targhooks.cc | 20 ++++++++++++++++++++
     gcc/targhooks.h  |  2 ++
     3 files changed, 26 insertions(+)

    diff --git gcc/target-def.h gcc/target-def.h
    index f81f8fe3bb3..5e5cc3b767e 100644
    --- gcc/target-def.h
    +++ gcc/target-def.h
    @@ -62,6 +62,8 @@
     # else
     #  ifdef TARGET_ASM_NAMED_SECTION
     #   define TARGET_ASM_CONSTRUCTOR default_named_section_asm_out_constructor
    +#  else
    +#   define TARGET_ASM_CONSTRUCTOR default_asm_out_constructor
     #  endif
     # endif
     #endif
    @@ -72,6 +74,8 @@
     # else
     #  ifdef TARGET_ASM_NAMED_SECTION
     #   define TARGET_ASM_DESTRUCTOR default_named_section_asm_out_destructor
    +#  else
    +#   define TARGET_ASM_DESTRUCTOR default_asm_out_destructor
     #  endif
     # endif
     #endif
    diff --git gcc/targhooks.cc gcc/targhooks.cc
    index d17d393baed..12a58456b39 100644
    --- gcc/targhooks.cc
    +++ 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 gcc/targhooks.h gcc/targhooks.h
    index ecce55ebe79..a6a423c1abb 100644
    --- gcc/targhooks.h
    +++ 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);


Grüße
 Thomas


-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Better-integrate-default-sorry-TARGET_ASM_CONSTRUCTO.patch --]
[-- Type: text/x-diff, Size: 6812 bytes --]

From a05d8e1d15ea08526639ba154e59b6822b704f4c Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Thu, 3 Nov 2022 17:29:13 +0100
Subject: [PATCH] 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.
---
 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(-)
 delete mode 100644 gcc/dbxout.cc
 delete mode 100644 gcc/dbxout.h

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index c4072d06a936..f672e6ea5498 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 4cb5d02d40cd..2fe120b38730 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 161eeb196537..000000000000
--- 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
-<http://www.gnu.org/licenses/>.  */
-
-#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 ad0b538cabf1..000000000000
--- 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
-<http://www.gnu.org/licenses/>.  */
-
-#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 1c4aa2963dc4..5e5cc3b767e1 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 d17d393baedc..12a58456b399 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 ecce55ebe797..a6a423c1abb4 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);
-- 
2.35.1


  reply	other threads:[~2022-11-04  9:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-01 10:05 [PATCH 1/3] STABS: remove -gstabs and -gxcoff functionality Martin Liška
2022-09-01 10:05 ` Martin Liška
2022-09-01 11:18 ` Richard Biener
2022-09-02  7:00   ` Martin Liška
2022-09-02  8:54     ` Richard Biener
2022-09-05  7:59       ` Martin Liška
2022-09-05  9:05         ` Richard Biener
2022-09-14 12:19 ` [COMMITTED] Fix unused variable warning (was: [PATCH 1/3] STABS: remove -gstabs and -gxcoff functionality) Jan-Benedict Glaw
2022-09-14 13:20   ` Martin Liška
2022-10-10 14:19 ` Restore default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR' " Thomas Schwinge
2022-10-10 14:23   ` Tom de Vries
2022-10-11  6:40     ` Richard Biener
2022-11-04  9:12       ` Thomas Schwinge [this message]
2022-10-12  9:21   ` Martin Liška
2022-11-04  9:04     ` Thomas Schwinge
2022-11-04  9:07       ` Thomas Schwinge
2022-11-04  9:32 ` [PATCH 1/3] STABS: remove -gstabs and -gxcoff functionality Thomas Schwinge
2022-11-10 14:02   ` Martin Liška
2022-11-10 14:12     ` Michael Matz
2022-11-10 14:13       ` Martin Liška

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pme32idj.fsf@euler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mliska@suse.cz \
    --cc=richard.guenther@gmail.com \
    --cc=tdevries@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).