This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] [Darwin PPC] Fix g++.dg/template/inline1.C
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: Geoff Keating <geoffk at geoffk dot org>, gcc-patches at gcc dot gnu dot org
- Date: Sun, 27 Jul 2003 12:27:52 -0400
- Subject: Re: [PATCH] [Darwin PPC] Fix g++.dg/template/inline1.C
On Wednesday, Jul 16, 2003, at 14:27 US/Eastern, Andrew Pinski wrote:
This is OK.
This code all seems unnecessarily complicated, I don't know what would
be wrong with just generating a numbered label like 'Lstub23', but
whatever.
I am going to change this so it uses the form as the regular pic label
is
generated so that the need for this hack is no longer needed.
Here is the patch which gets rid of this hack and overcomplicated
method.
Thanks,
Andrew Pinski
ChangeLog:
* rs6000.c (GEN_LOCAL_LABEL_FOR_SYMBOL): Remove.
(machopic_output_stub): Only generate pic base symbols when using pic
and generate them in the form L00000000$spb.
Patch:
Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.510
diff -u -p -r1.510 rs6000.c
--- rs6000.c 26 Jul 2003 07:34:21 -0000 1.510
+++ rs6000.c 27 Jul 2003 16:08:41 -0000
@@ -13914,25 +13914,6 @@ output_call (insn, call_dest, operand_nu
#endif /* RS6000_LONG_BRANCH */
-#define GEN_LOCAL_LABEL_FOR_SYMBOL(BUF,SYMBOL,LENGTH,N) \
- do { \
- const char *const symbol_ = (SYMBOL); \
- char *buffer_ = (BUF); \
- if (symbol_[0] == '"') \
- { \
- sprintf(buffer_, "\"L%d$%s", (N), symbol_+1); \
- } \
- else if (name_needs_quotes(symbol_)) \
- { \
- sprintf(buffer_, "\"L%d$%s\"", (N), symbol_); \
- } \
- else \
- { \
- sprintf(buffer_, "L%d$%s", (N), symbol_); \
- } \
- } while (0)
-
-
/* Generate PIC and indirect symbol stubs. */
void
@@ -13948,7 +13929,6 @@ machopic_output_stub (file, symb, stub)
/* Lose our funky encoding stuff so it doesn't contaminate the stub.
*/
symb = (*targetm.strip_name_encoding) (symb);
- label += 1;
length = strlen (symb);
symbol_name = alloca (length + 32);
@@ -13957,9 +13937,6 @@ machopic_output_stub (file, symb, stub)
lazy_ptr_name = alloca (length + 32);
GEN_LAZY_PTR_NAME_FOR_SYMBOL (lazy_ptr_name, symb, length);
- local_label_0 = alloca (length + 32);
- GEN_LOCAL_LABEL_FOR_SYMBOL (local_label_0, symb, length, 0);
-
if (flag_pic == 2)
machopic_picsymbol_stub1_section ();
else
@@ -13971,6 +13948,10 @@ machopic_output_stub (file, symb, stub)
if (flag_pic == 2)
{
+ label++;
+ local_label_0 = alloca (sizeof("\"L0000000000$spb\""));
+ sprintf (local_label_0, "\"L%011d$spb\"", label);
+
fprintf (file, "\tmflr r0\n");
fprintf (file, "\tbcl 20,31,%s\n", local_label_0);
fprintf (file, "%s:\n\tmflr r11\n", local_label_0);