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]

Re: output # <srcline> between #APP and #NO_APP, for asm statements


On Mar  9, 2007, Andreas Schwab <schwab@suse.de> wrote:

> Alexandre Oliva <aoliva@redhat.com> writes:
>> On Mar  9, 2007, Andreas Schwab <schwab@suse.de> wrote:
>> 
>>> No mixed declarations and code.
>> 
>> Ugh, thanks.  Fixed thusly.  (Only compile-checked).

> I'm getting a crash while compiling libjava:

Likewise.  Sorry.  I'm now sure something went wrong in my testing the
original patch.

I've just checked this in, as obvious.

for  gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* rtl.h (gen_rtx_ASM_INPUT): Use "" instead of NULL file name.
	* final.c (final_scan_insn): Test for non-"" file name.

Index: gcc/final.c
===================================================================
--- gcc/final.c.orig	2007-03-09 11:43:23.000000000 -0300
+++ gcc/final.c	2007-03-09 11:44:21.000000000 -0300
@@ -2081,7 +2081,7 @@ final_scan_insn (rtx insn, FILE *file, i
 		loc.file = ASM_INPUT_SOURCE_FILE (body);
 		loc.line = ASM_INPUT_SOURCE_LINE (body);
 #endif
-		if (loc.file && loc.line)
+		if (*loc.file && loc.line)
 		  fprintf (asm_out_file, "%s %i \"%s\" 1\n",
 			   ASM_COMMENT_START, loc.line, loc.file);
 		fprintf (asm_out_file, "\t%s\n", string);
Index: gcc/rtl.h
===================================================================
--- gcc/rtl.h.orig	2007-03-09 04:24:37.000000000 -0300
+++ gcc/rtl.h	2007-03-09 11:44:34.000000000 -0300
@@ -1875,7 +1875,7 @@ extern GTY(()) rtx return_address_pointe
   gen_rtx_fmt_si (ASM_INPUT, (MODE), (ARG0), (LOC))
 #else
 #define gen_rtx_ASM_INPUT(MODE, ARG0)				\
-  gen_rtx_fmt_ssi (ASM_INPUT, (MODE), (ARG0), NULL, 0)
+  gen_rtx_fmt_ssi (ASM_INPUT, (MODE), (ARG0), "", 0)
 #define gen_rtx_ASM_INPUT_loc(MODE, ARG0, LOC)			\
   gen_rtx_fmt_ssi (ASM_INPUT, (MODE), (ARG0), (LOC).file, (LOC).line)
 #undef gen_rtx_ASM_OPERANDS
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member         http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

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