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]

equalize C and C++ asm


Currently the C++ asm statements cannot always have the same form as
their C counterparts.  E.g.,

	asm ("..." :: "r" (foo));

is misparsed.  Because this is easy to fix I'd like to commit the
appended patch.  Could somebody look at it?

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2000-01-29  Ulrich Drepper  <drepper@redhat.com>

	* parse.y (simple_stmt): Allow :: token in asm parameter list.

Index: cp/parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/parse.y,v
retrieving revision 1.160
diff -u -u -w -r1.160 parse.y
--- parse.y	2000/01/26 20:51:36	1.160
+++ parse.y	2000/01/30 02:07:30
@@ -3249,10 +3249,18 @@
 	/* This is the case with input operands as well.  */
 	| asm_keyword maybe_cv_qualifier '(' string ':' asm_operands ':' asm_operands ')' ';'
 		{ finish_asm_stmt ($2, $4, $6, $8, NULL_TREE); }
+	| asm_keyword maybe_cv_qualifier '(' string SCOPE asm_operands ')' ';'
+		{ finish_asm_stmt ($2, $4, NULL_TREE, $6, NULL_TREE); }
 	/* This is the case with clobbered registers as well.  */
 	| asm_keyword maybe_cv_qualifier '(' string ':' asm_operands ':'
 	  asm_operands ':' asm_clobbers ')' ';'
 		{ finish_asm_stmt ($2, $4, $6, $8, $10); }
+	| asm_keyword maybe_cv_qualifier '(' string SCOPE asm_operands ':'
+	  asm_clobbers ')' ';'
+		{ finish_asm_stmt ($2, $4, NULL_TREE, $6, $8); }
+	| asm_keyword maybe_cv_qualifier '(' string ':' asm_operands SCOPE
+	  asm_clobbers ')' ';'
+		{ finish_asm_stmt ($2, $4, $6, NULL_TREE, $8); }
 	| GOTO '*' expr ';'
                 { 
 		  if (pedantic)

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