This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ asm clobber fix
- To: gcc-patches at gcc dot gnu dot org
- Subject: C++ asm clobber fix
- From: Hidvegi <hzoli at austin dot ibm dot com>
- Date: Tue, 30 May 2000 16:30:02 -0500 (CDT)
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.