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]

Fix gcc coredump



See, e.g. in dwarf2out.c::output_file_names()

	    ASM_OUTPUT_ASCII (asm_out_file, dirs[i].path, dirs[i].length - 1);

Regards,
-velco

2001-03-13  Momchil Velikov  <velco@fadata.bg>

	* gcc/config/arm/aof.h (ASM_OUTPUT_ASCII): Declare local variables
	after the last use of the macro arguments.

	* gcc/config/mips/bsd-5.h (ASM_OUTPUT_ASCII): Likewise.  

	* gcc/config/mips/iris4.h (ASM_OUTPUT_ASCII): Likewise.  

	* gcc/config/mips/mips-5.h (ASM_OUTPUT_ASCII): Likewise.  

	* gcc/config/mips/mips.h (ASM_OUTPUT_ASCII): Likewise.  

	* gcc/config/mips/svr3-5.h (ASM_OUTPUT_ASCII): Likewise.  

	* gcc/config/mips/svr4-5.h (ASM_OUTPUT_ASCII): Likewise.  



Index: gcc/config/arm/aof.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/aof.h,v
retrieving revision 1.10
diff -c -3 -p -r1.10 aof.h
*** aof.h	2000/09/25 12:08:01	1.10
--- aof.h	2001/03/13 16:24:01
*************** do {							\
*** 271,283 ****
  
  #define ASM_OUTPUT_ASCII(STREAM,PTR,LEN)		\
  {							\
-   int i;						\
    const char *ptr = (PTR);				\
    fprintf ((STREAM), "\tDCB");				\
!   for (i = 0; i < (LEN); i++)				\
      fprintf ((STREAM), " &%02x%s", 			\
  	     (unsigned ) *(ptr++),			\
! 	     (i + 1 < (LEN)				\
  	      ? ((i & 3) == 3 ? "\n\tDCB" : ",")	\
  	      : "\n"));					\
  }
--- 271,284 ----
  
  #define ASM_OUTPUT_ASCII(STREAM,PTR,LEN)		\
  {							\
    const char *ptr = (PTR);				\
+   int len = (LEN);					\
+   int i;						\
    fprintf ((STREAM), "\tDCB");				\
!   for (i = 0; i < len; i++)				\
      fprintf ((STREAM), " &%02x%s", 			\
  	     (unsigned ) *(ptr++),			\
! 	     (i + 1 < len				\
  	      ? ((i & 3) == 3 ? "\n\tDCB" : ",")	\
  	      : "\n"));					\
  }
Index: gcc/config/mips/bsd-5.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/bsd-5.h,v
retrieving revision 1.4
diff -c -3 -p -r1.4 bsd-5.h
*** bsd-5.h	2000/11/02 23:29:11	1.4
--- bsd-5.h	2001/03/13 16:24:05
*************** Boston, MA 02111-1307, USA.  */
*** 55,63 ****
  #undef ASM_OUTPUT_ASCII
  #define ASM_OUTPUT_ASCII(FILE,PTR,LEN)			\
  do {							\
!   const unsigned char *s;				\
    int i;						\
!   for (i = 0, s = (const unsigned char *)(PTR); i < (LEN); s++, i++) \
      {							\
        if ((i % 8) == 0)					\
  	fputs ("\n\t.byte\t", (FILE));			\
--- 55,65 ----
  #undef ASM_OUTPUT_ASCII
  #define ASM_OUTPUT_ASCII(FILE,PTR,LEN)			\
  do {							\
!   int len = (LEN);					\
!   const unsigned char *s =				\
!     (const unsigned char *) (PTR);			\
    int i;						\
!   for (i = 0; i < len; s++, i++)			\
      {							\
        if ((i % 8) == 0)					\
  	fputs ("\n\t.byte\t", (FILE));			\
Index: gcc/config/mips/iris4.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/iris4.h,v
retrieving revision 1.4
diff -c -3 -p -r1.4 iris4.h
*** iris4.h	1999/10/24 19:48:51	1.4
--- iris4.h	2001/03/13 16:24:06
*************** Boston, MA 02111-1307, USA.  */
*** 32,40 ****
  #undef ASM_OUTPUT_ASCII
  #define ASM_OUTPUT_ASCII(FILE,PTR,LEN)			\
  do {							\
!   const unsigned char *s;				\
    int i;						\
!   for (i = 0, s = (const unsigned char *)(PTR); i < (LEN); s++, i++) \
      {							\
        if ((i % 8) == 0)					\
  	fputs ("\n\t.byte\t", (FILE));			\
--- 32,42 ----
  #undef ASM_OUTPUT_ASCII
  #define ASM_OUTPUT_ASCII(FILE,PTR,LEN)			\
  do {							\
!   const unsigned char *s =				\
!     (const unsigned char *) (PTR);			\
!   int len = (LEN);					\
    int i;						\
!   for (i = 0; i < len; s++, i++)			\
      {							\
        if ((i % 8) == 0)					\
  	fputs ("\n\t.byte\t", (FILE));			\
Index: gcc/config/mips/mips-5.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips-5.h,v
retrieving revision 1.3
diff -c -3 -p -r1.3 mips-5.h
*** mips-5.h	1999/10/24 19:48:51	1.3
--- mips-5.h	2001/03/13 16:24:06
*************** Boston, MA 02111-1307, USA.  */
*** 34,42 ****
  #undef ASM_OUTPUT_ASCII
  #define ASM_OUTPUT_ASCII(FILE,PTR,LEN)			\
  do {							\
!   const unsigned char *s;				\
    int i;						\
!   for (i = 0, s = (const unsigned char *)(PTR); i < (LEN); s++, i++) \
      {							\
        if ((i % 8) == 0)					\
  	fputs ("\n\t.byte\t", (FILE));			\
--- 34,44 ----
  #undef ASM_OUTPUT_ASCII
  #define ASM_OUTPUT_ASCII(FILE,PTR,LEN)			\
  do {							\
!   const unsigned char *s =				\
!     (const unsigned char *) (PTR);			\
!   int len = (LEN);					\
    int i;						\
!   for (i = 0; i < len; s++, i++)			\
      {							\
        if ((i % 8) == 0)					\
  	fputs ("\n\t.byte\t", (FILE));			\
Index: gcc/config/mips/mips.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.h,v
retrieving revision 1.108
diff -c -3 -p -r1.108 mips.h
*** mips.h	2001/02/04 12:11:51	1.108
--- mips.h	2001/03/13 16:25:00
*************** do {									\
*** 4371,4379 ****
  /* This is how to output a string.  */
  #define ASM_OUTPUT_ASCII(STREAM, STRING, LEN)				\
  do {									\
!   register int i, c, len = (LEN), cur_pos = 17;				\
    register const unsigned char *string =				\
      (const unsigned char *)(STRING);					\
    fprintf ((STREAM), "\t.ascii\t\"");					\
    for (i = 0; i < len; i++)						\
      {									\
--- 4371,4380 ----
  /* This is how to output a string.  */
  #define ASM_OUTPUT_ASCII(STREAM, STRING, LEN)				\
  do {									\
!   register int len = (LEN);						\
    register const unsigned char *string =				\
      (const unsigned char *)(STRING);					\
+   register int i, c, cur_pos = 17;					\
    fprintf ((STREAM), "\t.ascii\t\"");					\
    for (i = 0; i < len; i++)						\
      {									\
Index: gcc/config/mips/svr3-5.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/svr3-5.h,v
retrieving revision 1.4
diff -c -3 -p -r1.4 svr3-5.h
*** svr3-5.h	2000/11/02 23:29:12	1.4
--- svr3-5.h	2001/03/13 16:25:01
*************** Boston, MA 02111-1307, USA.  */
*** 77,85 ****
  #undef ASM_OUTPUT_ASCII
  #define ASM_OUTPUT_ASCII(FILE,PTR,LEN)			\
  do {							\
!   const unsigned char *s;				\
    int i;						\
!   for (i = 0, s = (const unsigned char *)(PTR); i < (LEN); s++, i++) \
      {							\
        if ((i % 8) == 0)					\
  	fputs ("\n\t.byte\t", (FILE));			\
--- 77,87 ----
  #undef ASM_OUTPUT_ASCII
  #define ASM_OUTPUT_ASCII(FILE,PTR,LEN)			\
  do {							\
!   int len = (LEN);					\
!   const unsigned char *s =				\
!     (const unsigned char *) (PTR);			\
    int i;						\
!   for (i = 0; i < len; s++, i++)			\
      {							\
        if ((i % 8) == 0)					\
  	fputs ("\n\t.byte\t", (FILE));			\
Index: gcc/config/mips/svr4-5.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/svr4-5.h,v
retrieving revision 1.5
diff -c -3 -p -r1.5 svr4-5.h
*** svr4-5.h	2000/11/02 23:29:12	1.5
--- svr4-5.h	2001/03/13 16:25:02
*************** Boston, MA 02111-1307, USA.  */
*** 76,84 ****
  #undef ASM_OUTPUT_ASCII
  #define ASM_OUTPUT_ASCII(FILE,PTR,LEN)			\
  do {							\
!   const unsigned char *s;				\
    int i;						\
!   for (i = 0, s = (const unsigned char *)(PTR); i < (LEN); s++, i++) \
      {							\
        if ((i % 8) == 0)					\
  	fputs ("\n\t.byte\t", (FILE));			\
--- 76,86 ----
  #undef ASM_OUTPUT_ASCII
  #define ASM_OUTPUT_ASCII(FILE,PTR,LEN)			\
  do {							\
!   int len = (LEN);					\
!   const unsigned char *s =				\
!     (const unsigned char *) (PTR);			\
    int i;						\
!   for (i = 0; i < len; s++, i++)			\
      {							\
        if ((i % 8) == 0)					\
  	fputs ("\n\t.byte\t", (FILE));			\


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