This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rs6000] Preserve link stack for 476 cpus
- From: Peter Bergner <bergner at vnet dot ibm dot com>
- To: David Edelsohn <dje dot gcc at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 02 Nov 2011 13:40:34 -0500
- Subject: Re: [PATCH, rs6000] Preserve link stack for 476 cpus
- References: <1315843660.6209.45.camel@otta> <CAGWvny=W7SgRM_Y-nacv3mxQtx9dFDow7KMQPp_QcwCBUpcD9A@mail.gmail.com> <1318520967.3133.69.camel@otta> <4E9719DD.7000304@redhat.com> <1319766189.2996.39.camel@otta> <4EAAC83B.8030106@redhat.com> <1319819781.2996.73.camel@otta> <CAGWvnymQvAEFbDdtBN_jTNm8+ZRZoxxGfVNZcn4xvnGNHXbygQ@mail.gmail.com> <1320096758.2996.175.camel@otta> <CAGWvnymFMJF3qfhzTx=y70eLRMbgXah7U64iPdrD2-YnJayXDA@mail.gmail.com> <1320174025.2996.249.camel@otta> <CAGWvnykysMCa6yvvLCq4N1ndjcv8vEmb3-EEQ=ZaKvjXZ+MB-Q@mail.gmail.com>
On Wed, 2011-11-02 at 13:18 -0400, David Edelsohn wrote:
> The two new functions have mistakes because I did not realize the
> semantics of HAVE_GAS_HIDDEN. HAVE_GAS_HIDDEN is not a macro to be
> tested at runtime, but a macro tested at compile time.
I'm sorry, I didn't realize that either. Does the following fix
your problem?
Peter
* config/rs6000/rs6000.c (USE_HIDDEN_LINKONCE): New define.
(get_ppc476_thunk_name): Use it.
(rs6000_code_end): Likewise.
Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c (revision 180786)
+++ config/rs6000/rs6000.c (working copy)
@@ -27949,6 +27949,12 @@ rs6000_save_toc_in_prologue_p (void)
return (cfun && cfun->machine && cfun->machine->save_toc_in_prologue);
}
+#ifdef HAVE_GAS_HIDDEN
+# define USE_HIDDEN_LINKONCE 1
+#else
+# define USE_HIDDEN_LINKONCE 0
+#endif
+
/* Fills in the label name that should be used for a 476 link stack thunk. */
void
@@ -27956,7 +27962,7 @@ get_ppc476_thunk_name (char name[32])
{
gcc_assert (TARGET_LINK_STACK);
- if (HAVE_GAS_HIDDEN)
+ if (USE_HIDDEN_LINKONCE)
sprintf (name, "__ppc476.get_thunk");
else
ASM_GENERATE_INTERNAL_LABEL (name, "LPPC476_", 0);
@@ -27983,7 +27989,7 @@ rs6000_code_end (void)
TREE_PUBLIC (decl) = 1;
TREE_STATIC (decl) = 1;
- if (HAVE_GAS_HIDDEN)
+ if (USE_HIDDEN_LINKONCE)
{
DECL_COMDAT_GROUP (decl) = DECL_ASSEMBLER_NAME (decl);
targetm.asm_out.unique_section (decl, 0);