From: Andrew Pinski <apinski@apple.com>
To: gcc-patches@gcc.gnu.org
Cc: gcc@gcc.gnu.org, Andrew Pinski <pinskia@physics.uc.edu>,
Andrew Pinski <apinski@apple.com>
Subject: [PATCH] Re: 21 GCC HEAD regressions, 2 new, with your patch on 2004-07-07T22:45:18Z.
Date: Fri, 09 Jul 2004 06:24:00 -0000 [thread overview]
Message-ID: <4C6A1D9B-D16D-11D8-BC99-00039351ED8A@apple.com> (raw)
In-Reply-To: <20040709055003.GA29236@lucon.org>
>
> It looks like we may need a undo_make_decl_one_only if we have to
> change our mind like that.
Yes and I was just creating one.
Here is the patch which fixes the problem for me on
powerpc-apple-darwin.
OK? Bootstrapped on powerpc-apple-darwin.
I have not added to the other targets which need the macro also.
The C++ part and the other target support is needed for the 3.4 branch
also.
Thanks,
Andrew Pinski
ChangLog:
* config/darwin-protos.h (darwin_make_decl_non_one_only): Prototype.
* config/darwin.c (darwin_make_decl_non_one_only): Declare.
* config/darwin.h (MAKE_DECL_NON_ONE_ONLY): Declare.
* doc/tm.texi (MAKE_DECL_NON_ONE_ONLY): Document.
cp/ChangeLog:
* cp/rtti.c (emit_tinfo_decl): Call MAKE_DECL_NON_ONE_ONLY when
making the decl non weak.
Index: config/darwin-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin-protos.h,v
retrieving revision 1.35
diff -u -p -r1.35 darwin-protos.h
--- config/darwin-protos.h 19 May 2004 02:11:42 -0000 1.35
+++ config/darwin-protos.h 9 Jul 2004 05:54:57 -0000
@@ -85,6 +85,7 @@ extern void darwin_pragma_unused (struct
extern void darwin_file_end (void);
extern void darwin_make_decl_one_only (tree decl);
+extern void darwin_make_decl_non_one_only (tree decl);
/* Expanded by EXTRA_SECTION_FUNCTIONS into varasm.o. */
extern void const_section (void);
Index: config/darwin.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.c,v
retrieving revision 1.70
diff -u -p -r1.70 darwin.c
--- config/darwin.c 8 Jul 2004 00:12:27 -0000 1.70
+++ config/darwin.c 9 Jul 2004 05:54:57 -0000
@@ -1142,6 +1142,14 @@ darwin_make_decl_one_only (tree decl)
}
void
+darwin_make_decl_non_one_only (tree decl)
+{
+ TREE_PUBLIC (decl) = 0;
+ DECL_ONE_ONLY (decl) = 0;
+ DECL_SECTION_NAME (decl) = NULL;
+}
+
+void
machopic_select_section (tree exp, int reloc,
unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{
Index: config/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.h,v
retrieving revision 1.83
diff -u -p -r1.83 darwin.h
--- config/darwin.h 8 Jul 2004 00:12:27 -0000 1.83
+++ config/darwin.h 9 Jul 2004 05:54:57 -0000
@@ -336,6 +336,10 @@ do { text_section (); \
/* Making a symbols weak on Darwin requires more than just setting
DECL_WEAK. */
#define MAKE_DECL_ONE_ONLY(DECL) darwin_make_decl_one_only (DECL)
+/* Making a symbol non-weak again on Darwin requires more than just
setting
+ DECL_WEAK. */
+#define MAKE_DECL_NON_ONE_ONLY(DECL) darwin_make_decl_non_one_only
(DECL)
+
/* Representation of linkonce symbols for the MACH-O assembler.
Linkonce
symbols must be given a special section *and* must be preceded by a
special assembler directive. */
Index: cp/rtti.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/rtti.c,v
retrieving revision 1.186
diff -u -p -r1.186 rtti.c
--- cp/rtti.c 7 Jul 2004 18:29:38 -0000 1.186
+++ cp/rtti.c 9 Jul 2004 05:54:57 -0000
@@ -1464,7 +1464,15 @@ emit_tinfo_decl (tree decl)
{
DECL_COMDAT (decl) = 0;
if (SUPPORTS_ONE_ONLY)
- DECL_ONE_ONLY (decl) = 0;
+ {
+ if (DECL_ONE_ONLY (decl))
+ {
+#ifdef MAKE_DECL_NON_ONE_ONLY
+ MAKE_DECL_NON_ONE_ONLY (decl);
+#endif
+ DECL_ONE_ONLY (decl) = 0;
+ }
+ }
}
DECL_INITIAL (decl) = var_init;
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.337
diff -u -p -r1.337 tm.texi
--- doc/tm.texi 5 Jul 2004 19:49:20 -0000 1.337
+++ doc/tm.texi 9 Jul 2004 05:54:58 -0000
@@ -6763,6 +6763,13 @@ section flags in the Microsoft Windows P
requires changes to @var{decl}, such as putting it in a separate
section.
@end defmac
+@defmac MAKE_DECL_NON_ONE_ONLY (@var{decl})
+A C statement (sans semicolon) to mark @var{decl} to be emitted as a
+public symbol such that extra copies in multiple translation units will
+be not discarded by the linker. This is used to revert the effects of
+the MAKE_DECL_ONE_ONLY macro.
+@end defmac
+
@defmac SUPPORTS_ONE_ONLY
A C expression which evaluates to true if the target supports one-only
semantics.
next parent reply other threads:[~2004-07-09 6:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040709055003.GA29236@lucon.org>
2004-07-09 6:24 ` Andrew Pinski [this message]
2004-07-09 7:10 ` H. J. Lu
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=4C6A1D9B-D16D-11D8-BC99-00039351ED8A@apple.com \
--to=apinski@apple.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gcc@gcc.gnu.org \
--cc=pinskia@physics.uc.edu \
/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).