Patchwork Don't emit adjacent operands in -fdump-go-spec

mail settings
Submitter Ian Taylor
Date Jan. 29, 2011, 2:32 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/80919/
State New
Headers show


Ian Taylor - Jan. 29, 2011, 2:32 a.m.
This patch changes -fdump-go-spec to avoid emitting two adjacent
operands.  That sometimes happens when C code is using string
concatenation.  It would be possible in principle to use turn C adjacent
string concatenation to use Go's + operator, but for the current uses of
-fdump-go-spec that is an unimportant tweak.  Bootstrapped and ran Go
testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.


2011-01-28  Ian Lance Taylor  <>

	* godump.c (go_define): Ignore macros whose definitions include
	two adjacent operands.


Index: gcc/godump.c
--- gcc/godump.c	(revision 169270)
+++ gcc/godump.c	(working copy)
@@ -142,6 +142,9 @@  go_define (unsigned int lineno, const ch
 	    const char *start;
 	    char *n;
+	    if (saw_operand)
+	      goto unknown;
 	    start = p;
 	    while (ISALNUM (*p) || *p == '_')