This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch to create target hooks for ASM_OUTPUT_INTERNAL_LABEL


Regarding the multi-step process I started here:
http://gcc.gnu.org/ml/gcc-patches/2002-08/msg01366.html

This patch moves us closer to target hooks for outputting internal
labels.  Here I create the actual default and custom hook functions
and all of the targetm hackery.  However I left out the find & replace
of all target macro calls by definining ASM_OUTPUT_INTERNAL_LABEL to
*targetm.asm_out.internal_label in defaults.h for now.  (The next
patch will clean that up, this one is big enough.)

Tested via bootstrapping on sparc-sun-solaris2.7 and well as by
cross-compiling cc1 to:

arc-unknown-elf arm-semi-aof arm-semi-aout arm-unknown-aout
arm-unknown-coff arm-unknown-conix arm-unknown-elf
arm-unknown-freebsd5 arm-unknown-linux-gnu arm-unknown-netbsd
arm-unknown-oabi arm-unknown-pe arm-unknown-rtems arm-unknown-uclinux
arm-unknown-vxworks i370-unknown-linux-gnu i370-unknown-mvs
i370-unknown-opened m68k-hp-hpux m68k-hp-hpux7 m68k-unknown-linux-gnu
m88k-unknown-aout m88k-unknown-openbsd m88k-unknown-sysv4
sparc-sun-solaris2.7 strongarm-unknown-coff strongarm-unknown-elf
strongarm-unknown-pe

This stuff belongs on Zack's gcc-3_4-basic-improvements-branch I
suppose.  Ok to install this and the previous patch there?

		Thanks,
		--Kaveh


2002-08-23  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* Makefile.in (sdbout.o, insn-output.o): Depend on $(TARGET_H).
	* arc.c (arc_internal_label): New function.
	(TARGET_ASM_INTERNAL_LABEL): Set.
	* arc.h (ASM_OUTPUT_INTERNAL_LABEL): Delete.
	* arm.c (arm_internal_label): New function.
	(TARGET_ASM_INTERNAL_LABEL): Set.
	* arm.h (ASM_OUTPUT_INTERNAL_LABEL): Delete.
	* arm/elf.h (ASM_OUTPUT_INTERNAL_LABEL): Delete.
	* i370.c (i370_internal_label): New function.
	(TARGET_ASM_INTERNAL_LABEL): Set.
	* i370.h (ASM_OUTPUT_INTERNAL_LABEL): Delete.
	* m68k/hp320.h (ASM_OUTPUT_INTERNAL_LABEL): Delete.
	* m68k.c (m68k_hp320_internal_label): New function.
	(TARGET_ASM_INTERNAL_LABEL): Set.
	* m88k.c (m88k_internal_label): New function.
	(TARGET_ASM_INTERNAL_LABEL): Set.
	* m88k.h (ASM_OUTPUT_INTERNAL_LABEL): Delete.
	* defaults.h (ASM_OUTPUT_INTERNAL_LABEL): Set to target hook.
	* genoutput.c (output_prologue): Include target.h in output file.
	* output.h (default_internal_label): Declare.
	* sdbout.c: Include target.h.
	* target-def.h (TARGET_ASM_INTERNAL_LABEL): Set and add to
	TARGET_ASM_OUT.
	* target.h (internal_label): Add to struct gcc_target.
	* varasm.c (default_internal_label): New function.

diff -rup orig/egcc-CVS20020822/gcc/Makefile.in egcc-CVS20020822/gcc/Makefile.in
--- orig/egcc-CVS20020822/gcc/Makefile.in	Thu Aug 22 07:00:35 2002
+++ egcc-CVS20020822/gcc/Makefile.in	Fri Aug 23 16:11:41 2002
@@ -1461,7 +1461,7 @@ dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM
 debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H)
 sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
    function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) real.h \
-   insn-config.h xcoffout.h c-pragma.h ggc.h \
+   insn-config.h xcoffout.h c-pragma.h ggc.h $(TARGET_H) \
    sdbout.h toplev.h $(TM_P_H) except.h debug.h langhooks.h gt-sdbout.h
 dwarfout.o : dwarfout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) dwarf.h \
    flags.h insn-config.h reload.h output.h toplev.h $(TM_P_H) \
@@ -1820,7 +1820,7 @@ s-attrtab : $(md_file) genattrtab$(build
 insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) $(GGC_H) $(REGS_H) real.h \
     conditions.h hard-reg-set.h insn-config.h $(INSN_ATTR_H) $(EXPR_H) \
     output.h $(RECOG_H) function.h $(SYSTEM_H) toplev.h flags.h \
-    insn-codes.h $(TM_P_H)
+    insn-codes.h $(TM_P_H) $(TARGET_H)
 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c \
 	  $(OUTPUT_OPTION)
 
diff -rup orig/egcc-CVS20020822/gcc/config/arc/arc.c egcc-CVS20020822/gcc/config/arc/arc.c
--- orig/egcc-CVS20020822/gcc/config/arc/arc.c	Tue Aug 20 19:23:50 2002
+++ egcc-CVS20020822/gcc/config/arc/arc.c	Fri Aug 23 11:56:12 2002
@@ -93,6 +93,7 @@ static bool arc_assemble_integer PARAMS 
 static void arc_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
 static void arc_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
 static void arc_encode_section_info PARAMS ((tree, int));
+static void arc_internal_label PARAMS ((FILE *, const char *, unsigned long));
 
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_ALIGNED_HI_OP
@@ -110,6 +111,8 @@ static void arc_encode_section_info PARA
 #define TARGET_ATTRIBUTE_TABLE arc_attribute_table
 #undef TARGET_ENCODE_SECTION_INFO
 #define TARGET_ENCODE_SECTION_INFO arc_encode_section_info
+#undef TARGET_ASM_INTERNAL_LABEL
+#define  TARGET_ASM_INTERNAL_LABEL arc_internal_label
 
 struct gcc_target targetm = TARGET_INITIALIZER;
 
@@ -2358,4 +2361,17 @@ arc_encode_section_info (decl, first)
 {
   if (TREE_CODE (decl) == FUNCTION_DECL)
     SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
+}
+
+/* This is how to output a definition of an internal numbered label where
+   PREFIX is the class of label and NUM is the number within the class.  */
+
+static void
+arc_internal_label (stream, prefix, labelno)
+     FILE *stream;
+     const char *prefix;
+     unsigned long labelno;
+{
+  arc_ccfsm_at_label (prefix, labelno);
+  default_internal_label (stream, prefix, labelno);
 }
diff -rup orig/egcc-CVS20020822/gcc/config/arc/arc.h egcc-CVS20020822/gcc/config/arc/arc.h
--- orig/egcc-CVS20020822/gcc/config/arc/arc.h	Tue Jul 30 22:10:50 2002
+++ egcc-CVS20020822/gcc/config/arc/arc.h	Fri Aug 23 11:48:22 2002
@@ -1217,15 +1217,6 @@ do {							\
     }							\
 } while (0)
 
-/* This is how to output a definition of an internal numbered label where
-   PREFIX is the class of label and NUM is the number within the class.  */
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
-do {						\
-  arc_ccfsm_at_label (PREFIX, NUM);		\
-  fprintf (FILE, ".%s%d:\n", PREFIX, NUM);	\
-} while (0)
-
 /* Store in OUTPUT a string (made with alloca) containing
    an assembler-name for a local static variable named NAME.
    LABELNO is an integer which is different for each call.  */
diff -rup orig/egcc-CVS20020822/gcc/config/arm/arm.c egcc-CVS20020822/gcc/config/arm/arm.c
--- orig/egcc-CVS20020822/gcc/config/arm/arm.c	Tue Aug 20 22:37:33 2002
+++ egcc-CVS20020822/gcc/config/arm/arm.c	Fri Aug 23 15:00:33 2002
@@ -126,6 +126,7 @@ static void	 arm_encode_section_info	PAR
 #ifdef AOF_ASSEMBLER
 static void	 aof_globalize_label		PARAMS ((FILE *, const char *));
 #endif
+static void	 arm_internal_label		PARAMS ((FILE *, const char *, unsigned long));
 
 #undef Hint
 #undef Mmode
@@ -188,6 +189,9 @@ static void	 aof_globalize_label		PARAMS
 #undef TARGET_STRIP_NAME_ENCODING
 #define TARGET_STRIP_NAME_ENCODING arm_strip_name_encoding
 
+#undef TARGET_ASM_INTERNAL_LABEL
+#define TARGET_ASM_INTERNAL_LABEL arm_internal_label
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Obstack for minipool constant handling.  */
@@ -11047,3 +11051,18 @@ arm_encode_section_info (decl, first)
     }
 }
 #endif /* !ARM_PE */
+
+static void
+arm_internal_label (stream, prefix, labelno)
+     FILE *stream;
+     const char *prefix;
+     unsigned long labelno;
+{
+  if (arm_ccfsm_state == 3 && (unsigned) arm_target_label == labelno
+      && !strcmp (prefix, "L"))
+    {
+      arm_ccfsm_state = 0;
+      arm_target_insn = NULL;
+    }
+  default_internal_label (stream, prefix, labelno);
+}
diff -rup orig/egcc-CVS20020822/gcc/config/arm/arm.h egcc-CVS20020822/gcc/config/arm/arm.h
--- orig/egcc-CVS20020822/gcc/config/arm/arm.h	Thu Aug  8 16:03:52 2002
+++ egcc-CVS20020822/gcc/config/arm/arm.h	Fri Aug 23 14:13:50 2002
@@ -2458,25 +2458,6 @@ extern int making_const_table;
 #undef  ASM_APP_OFF
 #define ASM_APP_OFF (TARGET_THUMB ? "\t.code\t16\n" : "")
 
-/* Output an internal label definition.  */
-#ifndef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM)		\
-  do								\
-    {								\
-      char * s = (char *) alloca (40 + strlen (PREFIX));	\
-								\
-      if (arm_ccfsm_state == 3 && arm_target_label == (NUM)	\
-	  && !strcmp (PREFIX, "L"))				\
-	{							\
-	  arm_ccfsm_state = 0;					\
-	  arm_target_insn = NULL;				\
-	}							\
-      ASM_GENERATE_INTERNAL_LABEL (s, (PREFIX), (NUM));		\
-      ASM_OUTPUT_LABEL (STREAM, s);		                \
-    }								\
-  while (0)
-#endif
-
 /* Output a push or a pop instruction (only used when profiling).  */
 #define ASM_OUTPUT_REG_PUSH(STREAM, REGNO)		\
   if (TARGET_ARM)					\
diff -rup orig/egcc-CVS20020822/gcc/config/arm/elf.h egcc-CVS20020822/gcc/config/arm/elf.h
--- orig/egcc-CVS20020822/gcc/config/arm/elf.h	Sun Jul 28 16:00:09 2002
+++ egcc-CVS20020822/gcc/config/arm/elf.h	Fri Aug 23 14:13:59 2002
@@ -122,26 +122,6 @@ Boston, MA 02111-1307, USA.  */
     }								\
   while (0)
 #endif
-
-/* Output an internal label definition.  */
-#undef  ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM)  	\
-  do								\
-    {								\
-      char * s = (char *) alloca (40 + strlen (PREFIX));	\
-      extern int arm_target_label, arm_ccfsm_state;		\
-      extern rtx arm_target_insn;				\
-								\
-      if (arm_ccfsm_state == 3 && arm_target_label == (NUM)	\
-	  && !strcmp (PREFIX, "L"))				\
-	{							\
-	  arm_ccfsm_state = 0;					\
-	  arm_target_insn = NULL;				\
-	}							\
-      ASM_GENERATE_INTERNAL_LABEL (s, (PREFIX), (NUM));		\
-      ASM_OUTPUT_LABEL (STREAM, s);		                \
-    }								\
-  while (0)
 
 #undef  TARGET_ASM_NAMED_SECTION
 #define TARGET_ASM_NAMED_SECTION  arm_elf_asm_named_section
diff -rup orig/egcc-CVS20020822/gcc/config/i370/i370.c egcc-CVS20020822/gcc/config/i370/i370.c
--- orig/egcc-CVS20020822/gcc/config/i370/i370.c	Tue Aug 20 22:37:34 2002
+++ egcc-CVS20020822/gcc/config/i370/i370.c	Fri Aug 23 11:55:36 2002
@@ -109,6 +109,7 @@ static void i370_output_function_epilogu
 static int mvs_hash_alias PARAMS ((const char *));
 #endif
 static void i370_encode_section_info PARAMS ((tree, int));
+static void i370_internal_label PARAMS ((FILE *, const char *, unsigned long));
 
 /* ===================================================== */
 /* defines and functions specific to the HLASM assembler */
@@ -312,6 +313,8 @@ static const unsigned char ebcasc[256] =
 #define TARGET_ASM_FUNCTION_EPILOGUE i370_output_function_epilogue
 #undef TARGET_ENCODE_SECTION_INFO
 #define TARGET_ENCODE_SECTION_INFO i370_encode_section_info
+#undef TARGET_ASM_INTERNAL_LABEL
+#define  TARGET_ASM_INTERNAL_LABEL i370_internal_label
 
 struct gcc_target targetm = TARGET_INITIALIZER;
 
@@ -1585,3 +1588,14 @@ i370_encode_section_info (decl, first)
     SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
 }
 
+static void
+i370_internal_label (stream, prefix, labelno)
+     FILE *stream;
+     const char *prefix;
+     unsigned long labelno;
+{
+  if (!strcmp (prefix, "L"))
+    mvs_add_label(labelno);
+
+  default_internal_label (stream, prefix, labelno);
+}
diff -rup orig/egcc-CVS20020822/gcc/config/i370/i370.h egcc-CVS20020822/gcc/config/i370/i370.h
--- orig/egcc-CVS20020822/gcc/config/i370/i370.h	Tue Aug 20 22:37:35 2002
+++ egcc-CVS20020822/gcc/config/i370/i370.h	Fri Aug 23 11:51:48 2002
@@ -1096,18 +1096,6 @@ enum reg_class
 #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM)			\
   sprintf (LABEL, "*%s%d", PREFIX, NUM)
 
-/* Generate internal label.  Since we can branch here from off page, we
-   must reload the base register.  */
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) 			\
-{									\
-  if (!strcmp (PREFIX,"L"))						\
-    {									\
-      mvs_add_label(NUM);						\
-    }									\
-  fprintf (FILE, "%s%d\tEQU\t*\n", PREFIX, NUM);			\
-}
-
 /* Generate case label.  For HLASM we can change to the data CSECT
    and put the vectors out of the code body. The assembler just
    concatenates CSECTs with the same name.  */
@@ -1834,19 +1822,6 @@ abort(); \
 #define ASM_DOUBLE "\t.double"     
 
 /* #define ASM_OUTPUT_LABELREF(FILE, NAME) */	/* use gas -- defaults.h */
-
-/* Generate internal label.  Since we can branch here from off page, we
-   must reload the base register.  Note that internal labels are generated
-   for loops, goto's and case labels.  */
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) 			\
-{									\
-  if (!strcmp (PREFIX,"L"))						\
-    {									\
-      mvs_add_label(NUM);						\
-    }									\
-  fprintf (FILE, ".%s%d:\n", PREFIX, NUM); 				\
-}
 
 /* let config/svr4.h define this ...
  *  #define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, TABLE)
diff -rup orig/egcc-CVS20020822/gcc/config/m68k/hp320.h egcc-CVS20020822/gcc/config/m68k/hp320.h
--- orig/egcc-CVS20020822/gcc/config/m68k/hp320.h	Sat May 18 16:00:38 2002
+++ egcc-CVS20020822/gcc/config/m68k/hp320.h	Fri Aug 23 13:45:28 2002
@@ -257,13 +257,6 @@ Boston, MA 02111-1307, USA.  */
 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12),	\
   sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
 
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)	\
-do{  if (PREFIX[0] == 'L' && PREFIX[1] == 'I')		\
-    fprintf(FILE, "\tset %s%d,.+2\n", PREFIX, NUM);	\
-  else							\
-    fprintf (FILE, "%s%d:\n", PREFIX, NUM);		\
-} while(0)
-
 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
   fprintf (FILE, "\tlong L%d\n", VALUE)
 
diff -rup orig/egcc-CVS20020822/gcc/config/m68k/m68k.c egcc-CVS20020822/gcc/config/m68k/m68k.c
--- orig/egcc-CVS20020822/gcc/config/m68k/m68k.c	Tue Aug 20 19:23:51 2002
+++ egcc-CVS20020822/gcc/config/m68k/m68k.c	Fri Aug 23 15:54:22 2002
@@ -65,6 +65,9 @@ static void m68k_coff_asm_named_section 
 #ifdef CTOR_LIST_BEGIN
 static void m68k_svr3_asm_out_constructor PARAMS ((rtx, int));
 #endif
+#ifdef HPUX_ASM
+static void m68k_hp320_internal_label PARAMS ((FILE *, const char *, unsigned long));
+#endif
 
 
 /* Alignment to use for loops and jumps */
@@ -121,6 +124,10 @@ int m68k_last_compare_had_fp_operands;
 #define TARGET_ASM_FUNCTION_PROLOGUE m68k_output_function_prologue
 #undef TARGET_ASM_FUNCTION_EPILOGUE
 #define TARGET_ASM_FUNCTION_EPILOGUE m68k_output_function_epilogue
+#ifdef HPUX_ASM
+#undef TARGET_ASM_INTERNAL_LABEL
+#define  TARGET_ASM_INTERNAL_LABEL m68k_hp320_internal_label
+#endif
 
 struct gcc_target targetm = TARGET_INITIALIZER;
 
@@ -3813,5 +3820,19 @@ m68k_svr3_asm_out_constructor (symbol, p
 
   init_section ();
   output_asm_insn (output_move_simode (xop), xop);
+}
+#endif
+
+#ifdef HPUX_ASM
+static void
+m68k_hp320_internal_label (stream, prefix, labelno)
+     FILE *stream;
+     const char *prefix;
+     unsigned long labelno;
+{
+  if (prefix[0] == 'L' && prefix[1] == 'I')
+    fprintf(stream, "\tset %s%ld,.+2\n", prefix, labelno);
+  else
+    fprintf (stream, "%s%ld:\n", prefix, labelno);
 }
 #endif
diff -rup orig/egcc-CVS20020822/gcc/config/m88k/m88k.c egcc-CVS20020822/gcc/config/m88k/m88k.c
--- orig/egcc-CVS20020822/gcc/config/m88k/m88k.c	Tue Jul 16 22:54:09 2002
+++ egcc-CVS20020822/gcc/config/m88k/m88k.c	Fri Aug 23 14:48:38 2002
@@ -74,6 +74,9 @@ static void m88k_svr3_asm_out_destructor
 static void m88k_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT));
 static int m88k_adjust_cost PARAMS ((rtx, rtx, rtx, int));
 static void m88k_encode_section_info PARAMS ((tree, int));
+#ifdef AS_BUG_DOT_LABELS
+static void m88k_internal_label PARAMS ((FILE *, const char *, unsigned long));
+#endif
 
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_BYTE_OP
@@ -101,6 +104,10 @@ static void m88k_encode_section_info PAR
 
 #undef TARGET_ENCODE_SECTION_INFO
 #define TARGET_ENCODE_SECTION_INFO  m88k_encode_section_info
+#ifdef AS_BUG_DOT_LABELS
+#undef TARGET_ASM_INTERNAL_LABEL
+#define  TARGET_ASM_INTERNAL_LABEL m88k_internal_label
+#endif
 
 struct gcc_target targetm = TARGET_INITIALIZER;
 
@@ -3339,3 +3346,15 @@ m88k_encode_section_info (decl, first)
 	SYMBOL_REF_FLAG (XEXP (TREE_CST_RTL (decl), 0)) = 1;
     }
 }
+
+#ifdef AS_BUG_DOT_LABELS /* The assembler requires a declaration of local.  */
+static void
+m88k_internal_label (stream, prefix, labelno)
+     FILE *stream;
+     const char *prefix;
+     unsigned long labelno;
+{
+  fprintf (stream, TARGET_SVR4 ? ".%s%lu:\n%s.%s%lu\n" : "@%s%ld:\n",
+	   prefix, labelno, INTERNAL_ASM_OP, prefix, labelno);
+}
+#endif
diff -rup orig/egcc-CVS20020822/gcc/config/m88k/m88k.h egcc-CVS20020822/gcc/config/m88k/m88k.h
--- orig/egcc-CVS20020822/gcc/config/m88k/m88k.h	Fri Aug 23 11:22:08 2002
+++ egcc-CVS20020822/gcc/config/m88k/m88k.h	Fri Aug 23 11:49:59 2002
@@ -1885,17 +1885,6 @@ do {									 \
     fputs (NAME, FILE);					\
   }
 
-/* This is how to output an internal numbered label where
-   PREFIX is the class of label and NUM is the number within the class.
-   For V.4, labels use `.' rather than `@'.  */
-
-#ifdef AS_BUG_DOT_LABELS /* The assembler requires a declaration of local.  */
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)			\
-  fprintf (FILE, TARGET_SVR4 ? ".%s%d:\n%s.%s%d\n" : "@%s%d:\n", \
-	   PREFIX, NUM, INTERNAL_ASM_OP, PREFIX, NUM)
-#endif /* AS_BUG_DOT_LABELS */
-
 /* This is how to store into the string LABEL
    the symbol_ref name of an internal numbered label where
    PREFIX is the class of label and NUM is the number within the class.
diff -rup orig/egcc-CVS20020822/gcc/defaults.h egcc-CVS20020822/gcc/defaults.h
--- orig/egcc-CVS20020822/gcc/defaults.h	Fri Aug 23 11:22:08 2002
+++ egcc-CVS20020822/gcc/defaults.h	Fri Aug 23 14:15:00 2002
@@ -151,15 +151,8 @@ do { fputs (integer_asm_op (POINTER_SIZE
 /* This is how to output an internal numbered label where PREFIX is
    the class of label and NUM is the number within the class.  */
 
-#ifndef ASM_OUTPUT_INTERNAL_LABEL
 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,LABELNO)		\
-  do {								\
-    const char *const prefix_ = (PREFIX);			\
-    char *const buf_ = alloca (40 + strlen (prefix_));		\
-    ASM_GENERATE_INTERNAL_LABEL (buf_, prefix_, (LABELNO));	\
-    ASM_OUTPUT_LABEL (FILE, buf_);				\
-  } while (0)
-#endif
+  (*targetm.asm_out.internal_label) (FILE, PREFIX, LABELNO)
 
 /* This is how to output a reference to a user-level label named NAME.  */
 
diff -rup orig/egcc-CVS20020822/gcc/genoutput.c egcc-CVS20020822/gcc/genoutput.c
--- orig/egcc-CVS20020822/gcc/genoutput.c	Tue Mar 12 00:28:43 2002
+++ egcc-CVS20020822/gcc/genoutput.c	Fri Aug 23 15:03:21 2002
@@ -235,6 +235,7 @@ output_prologue ()
   printf ("#include \"recog.h\"\n\n");
   printf ("#include \"toplev.h\"\n");
   printf ("#include \"output.h\"\n");
+  printf ("#include \"target.h\"\n");
 }
 
 
diff -rup orig/egcc-CVS20020822/gcc/output.h egcc-CVS20020822/gcc/output.h
--- orig/egcc-CVS20020822/gcc/output.h	Tue Aug 20 22:37:39 2002
+++ egcc-CVS20020822/gcc/output.h	Fri Aug 23 11:54:48 2002
@@ -538,6 +538,7 @@ extern void default_elf_select_rtx_secti
 extern const char *default_strip_name_encoding PARAMS ((const char *));
 extern bool default_binds_local_p PARAMS ((tree));
 extern void default_globalize_label PARAMS ((FILE *, const char *));
+extern void default_internal_label PARAMS ((FILE *, const char *, unsigned long));
 
 /* Emit data for vtable gc for GNU binutils.  */
 extern void assemble_vtable_entry PARAMS ((struct rtx_def *, HOST_WIDE_INT));
diff -rup orig/egcc-CVS20020822/gcc/sdbout.c egcc-CVS20020822/gcc/sdbout.c
--- orig/egcc-CVS20020822/gcc/sdbout.c	Thu Aug 15 16:00:12 2002
+++ egcc-CVS20020822/gcc/sdbout.c	Fri Aug 23 16:11:22 2002
@@ -61,6 +61,7 @@ static GTY(()) tree anonymous_types;
 #include "tm_p.h"
 #include "gsyms.h"
 #include "langhooks.h"
+#include "target.h"
 
 /* 1 if PARM is passed to this function in memory.  */
 
diff -rup orig/egcc-CVS20020822/gcc/target-def.h egcc-CVS20020822/gcc/target-def.h
--- orig/egcc-CVS20020822/gcc/target-def.h	Tue Aug 20 22:37:39 2002
+++ egcc-CVS20020822/gcc/target-def.h	Fri Aug 23 14:50:01 2002
@@ -57,6 +57,9 @@ Foundation, 59 Temple Place - Suite 330,
 #ifndef TARGET_ASM_GLOBALIZE_LABEL
 #define TARGET_ASM_GLOBALIZE_LABEL default_globalize_label
 #endif
+#ifndef TARGET_ASM_INTERNAL_LABEL
+#define TARGET_ASM_INTERNAL_LABEL default_internal_label
+#endif
 
 #define TARGET_ASM_FUNCTION_PROLOGUE default_function_pro_epilogue
 #define TARGET_ASM_FUNCTION_EPILOGUE default_function_pro_epilogue
@@ -145,6 +148,7 @@ Foundation, 59 Temple Place - Suite 330,
 			TARGET_ASM_UNALIGNED_INT_OP,		\
 			TARGET_ASM_INTEGER,			\
 			TARGET_ASM_GLOBALIZE_LABEL,		\
+			TARGET_ASM_INTERNAL_LABEL,		\
 			TARGET_ASM_FUNCTION_PROLOGUE,		\
 			TARGET_ASM_FUNCTION_END_PROLOGUE,	\
 			TARGET_ASM_FUNCTION_BEGIN_EPILOGUE,	\
diff -rup orig/egcc-CVS20020822/gcc/target.h egcc-CVS20020822/gcc/target.h
--- orig/egcc-CVS20020822/gcc/target.h	Tue Aug 20 22:37:39 2002
+++ egcc-CVS20020822/gcc/target.h	Fri Aug 23 14:45:30 2002
@@ -72,6 +72,9 @@ struct gcc_target
     /* Output code that will globalize a label.  */
     void (* globalize_label) PARAMS ((FILE *, const char *));
 
+    /* Output an internal label.  */
+    void (* internal_label) PARAMS ((FILE *, const char *, unsigned long));
+
     /* Output the assembler code for entry to a function.  */
     void (* function_prologue) PARAMS ((FILE *, HOST_WIDE_INT));
 
diff -rup orig/egcc-CVS20020822/gcc/varasm.c egcc-CVS20020822/gcc/varasm.c
--- orig/egcc-CVS20020822/gcc/varasm.c	Tue Aug 20 22:37:39 2002
+++ egcc-CVS20020822/gcc/varasm.c	Fri Aug 23 11:58:05 2002
@@ -5255,4 +5255,18 @@ default_globalize_label (stream, name)
 }
 #endif /* GLOBAL_ASM_OP */
   
+/* This is how to output an internal numbered label where PREFIX is
+   the class of label and NUM is the number within the class.  */
+
+void
+default_internal_label (stream, prefix, labelno)
+     FILE *stream;
+     const char *prefix;
+     unsigned long labelno;
+{
+  char *const buf = alloca (40 + strlen (prefix));
+  ASM_GENERATE_INTERNAL_LABEL (buf, prefix, labelno);
+  ASM_OUTPUT_LABEL (stream, buf);
+}
+
 #include "gt-varasm.h"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]