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]

AIX label rollover fix


	Testcase 990801-1.c was rolling over the label number which caused
varasm to print a label like

L..-1347440721:

which the assembler considered a different computation.

	This patch always genrates labels as unsigned and another typo.

	I belive that elfos.h contains a similar bug.

David


	* config/rs6000/xcoff.h (ASM_OUTPUT_INTERNAL_LABEL): Display count
	unsigned. 
	(ASM_GENERATE_INTERNAL_LABEL): Same.
	(UNIQUE_SECTION): Fix typo.

Index: xcoff.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/xcoff.h,v
retrieving revision 1.10
diff -c -p -r1.10 xcoff.h
*** xcoff.h	2001/11/15 05:21:09	1.10
--- xcoff.h	2001/12/02 22:50:48
*************** toc_section ()						\
*** 393,399 ****
     PREFIX is the class of label and NUM is the number within the class.  */
  
  #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)	\
!   fprintf (FILE, "%s..%d:\n", PREFIX, NUM)
  
  /* This is how to output an internal label prefix.  rs6000.c uses this
     when generating traceback tables.  */
--- 393,399 ----
     PREFIX is the class of label and NUM is the number within the class.  */
  
  #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)	\
!   fprintf (FILE, "%s..%u:\n", (PREFIX), (unsigned) (NUM))
  
  /* This is how to output an internal label prefix.  rs6000.c uses this
     when generating traceback tables.  */
*************** toc_section ()						\
*** 414,420 ****
     This is suitable for output with `assemble_name'.  */
  
  #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)	\
!   sprintf (LABEL, "*%s..%ld", (PREFIX), (long)(NUM))
  
  /* This is how to output an assembler line to define N characters starting
     at P to FILE.  */
--- 414,420 ----
     This is suitable for output with `assemble_name'.  */
  
  #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)	\
!   sprintf (LABEL, "*%s..%u", (PREFIX), (unsigned) (NUM))
  
  /* This is how to output an assembler line to define N characters starting
     at P to FILE.  */
*************** toc_section ()						\
*** 484,490 ****
      if (TREE_CODE (DECL) == FUNCTION_DECL) {		\
        name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
        len = strlen (name) + 5;				\
!       string = alloca (len) + 1;			\
        sprintf (string, ".%s[PR]", name);		\
        DECL_SECTION_NAME (DECL) = build_string (len, string); \
      }							\
--- 484,490 ----
      if (TREE_CODE (DECL) == FUNCTION_DECL) {		\
        name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
        len = strlen (name) + 5;				\
!       string = alloca (len + 1);			\
        sprintf (string, ".%s[PR]", name);		\
        DECL_SECTION_NAME (DECL) = build_string (len, string); \
      }							\


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