This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
ASM_OUTPUT_DWARF_STRING
- To: GCC Bugs <gcc-bugs at gcc dot gnu dot org>
- Subject: ASM_OUTPUT_DWARF_STRING
- From: Michael Eager <eager at mvista dot com>
- Date: Tue, 28 Aug 2001 14:49:02 -0700
- Organization: MontaVista Software, Inc.
gcc/dwarfout.c contains the following:
/* ASM_OUTPUT_DWARF_STRING is defined to output an ascii string, but to
NOT issue a trailing newline. We define ASM_OUTPUT_DWARF_STRING_NEWLINE
based on whether ASM_OUTPUT_DWARF_STRING is defined or not. If it is
defined, we call it, then issue the line feed. If not, we supply a
default defintion of calling ASM_OUTPUT_ASCII */
#ifndef ASM_OUTPUT_DWARF_STRING
#define ASM_OUTPUT_DWARF_STRING_NEWLINE(FILE,P) \
ASM_OUTPUT_ASCII ((FILE), P, strlen (P)+1)
#else
#define ASM_OUTPUT_DWARF_STRING_NEWLINE(FILE,P) \
ASM_OUTPUT_DWARF_STRING (FILE,P), ASM_OUTPUT_DWARF_STRING (FILE,"\n")
#endif
On the face of it, when ASM_OUTPUT_DWARF_STRING is defined, the generated
code is incorrect. Instead of generating a newline, it will generate
".ascii \012", or something similar.
The only target which defined ASM_OUTPUT_DWARF_STRING in gcc-2.95.3
was rs6000. This has been removed in gcc-3.0. So this incorrect code
is redundant. It might be reasonable to eliminate it.
Here's a patch to correct it:
Index: dwarfout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarfout.c,v
retrieving revision 1.98
diff -u -r1.98 dwarfout.c
--- dwarfout.c 2001/08/22 14:35:01 1.98
+++ dwarfout.c 2001/08/28 21:44:08
@@ -1360,7 +1360,7 @@
ASM_OUTPUT_ASCII ((FILE), P, strlen (P)+1)
#else
#define ASM_OUTPUT_DWARF_STRING_NEWLINE(FILE,P) \
- ASM_OUTPUT_DWARF_STRING (FILE,P), ASM_OUTPUT_DWARF_STRING (FILE,"\n")
+ ASM_OUTPUT_DWARF_STRING (FILE,P), ASM_OUTPUT_ASCII (FILE,"\n",1)
#endif
--
Michael Eager eager@mvista.com 408-328-8426
MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA 94085