gm2 does not allow single const string in ASM VOLATILE. The bugfix is to
modify AsmOperands in all passes except P3Build.bnf (which is correct).
The remaining passes need to make the term following the ConstExpression
optional.
gcc/m2/ChangeLog:
PR modula2/117777
* gm2-compiler/P0SyntaxCheck.bnf (AsmOperands): Allow term after
ConstExpression to be optional.
* gm2-compiler/P1Build.bnf (AsmOperands): Ditto.
* gm2-compiler/P2Build.bnf (AsmOperands): Ditto.
* gm2-compiler/PCBuild.bnf (AsmOperands): Ditto.
* gm2-compiler/PHBuild.bnf (AsmOperands): Ditto.
gcc/testsuite/ChangeLog:
PR modula2/117777
* gm2/extensions/asm/pass/conststr.mod: New test.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
AsmOperandName := [ NamedOperand ] =:
-AsmOperands := ConstExpression ':' AsmList [ ':' AsmList [ ':' TrashList ] ]
+AsmOperands := ConstExpression [ ':' AsmList [ ':' AsmList [ ':' TrashList ] ] ]
=:
AsmList := [ AsmElement ] { ',' AsmElement } =:
AsmOperandName := [ NamedOperand ] =:
-AsmOperands := ConstExpression ':' AsmList [ ':' AsmList [ ':' TrashList ] ]
+AsmOperands := ConstExpression [ ':' AsmList [ ':' AsmList [ ':' TrashList ] ] ]
=:
AsmList := [ AsmElement ] { ',' AsmElement } =:
AsmOperandName := [ NamedOperand ] =:
-AsmOperands := ConstExpression ':' AsmList [ ':' AsmList [ ':' TrashList ] ]
+AsmOperands := ConstExpression [ ':' AsmList [ ':' AsmList [ ':' TrashList ] ] ]
=:
AsmList := [ AsmElement ] { ',' AsmElement } =:
AsmOperandName := [ NamedOperand ] =:
-AsmOperands := ConstExpression ':' AsmList [ ':' AsmList [ ':' TrashList ] ]
+AsmOperands := ConstExpression [ ':' AsmList [ ':' AsmList [ ':' TrashList ] ] ]
=:
AsmList := [ AsmElement ] { ',' AsmElement } =:
AsmOperandName := [ NamedOperand ] =:
-AsmOperands := ConstExpression ':' AsmList [ ':' AsmList [ ':' TrashList ] ]
+AsmOperands := ConstExpression [ ':' AsmList [ ':' AsmList [ ':' TrashList ] ] ]
=:
AsmList := [ AsmElement ] { ',' AsmElement } =:
--- /dev/null
+MODULE conststr ;
+
+BEGIN
+ ASM VOLATILE ("")
+END conststr.