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]

C++ asm clobber fix


In C++ string concatenation does not work for the asm clobber string,
but it works in C.  I tested the April 12 snapshot which had the same
bug.  For example on PowerPC the following fails witrh syntax error:

void
foo(double *p)
{
    __asm__ __volatile__("lfd 14,0(%0)" : : "r" (p) : "fr" "14");
}

The patch below is for gcc-2.95.2.  I am not sure this is really the
right fix, I just copied the part from c-parse.y into cp/parse.y.

Zoli

 *** gcc/cp/parse.y~	Fri Sep  3 16:15:00 1999
 --- gcc/cp/parse.y	Tue May 30 15:41:10 2000
 ***************
 *** 3515,3524 ****
 	 ;
   
   asm_clobbers:
 ! 	  STRING
 ! 		{ $$ = tree_cons (NULL_TREE, $$, NULL_TREE); }
 ! 	| asm_clobbers ',' STRING
 ! 		{ $$ = tree_cons (NULL_TREE, $3, $$); }
 	 ;
   
   /* This is what appears inside the parens in a function declarator.
 --- 3515,3524 ----
 	 ;
   
   asm_clobbers:
 ! 	  string
 ! 		{ $$ = tree_cons (NULL_TREE, combine_strings ($1), NULL_TREE); }
 ! 	| asm_clobbers ',' string
 ! 		{ $$ = tree_cons (NULL_TREE, combine_strings ($3), $1); }
 	 ;
   
   /* This is what appears inside the parens in a function declarator.

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