aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGaius Mulley <gaiusmod2@gmail.com>2024-11-25 22:46:16 +0000
committerGaius Mulley <gaiusmod2@gmail.com>2024-11-25 22:46:16 +0000
commite6d26a21e0369081491941552900ab3cbfdd18a4 (patch)
tree49aa8ce6712219727b43b08f10f2bc3a8c19b7df /gcc
parentf6e00226a4ca63e76e3e0b3a09a4ce6223980981 (diff)
downloadgcc-e6d26a21e0369081491941552900ab3cbfdd18a4.zip
gcc-e6d26a21e0369081491941552900ab3cbfdd18a4.tar.gz
gcc-e6d26a21e0369081491941552900ab3cbfdd18a4.tar.bz2
PR modula2/117777: m2 does not allow single const string in asm volatile
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>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/m2/gm2-compiler/P0SyntaxCheck.bnf2
-rw-r--r--gcc/m2/gm2-compiler/P1Build.bnf2
-rw-r--r--gcc/m2/gm2-compiler/P2Build.bnf2
-rw-r--r--gcc/m2/gm2-compiler/PCBuild.bnf2
-rw-r--r--gcc/m2/gm2-compiler/PHBuild.bnf2
-rw-r--r--gcc/testsuite/gm2/extensions/asm/pass/conststr.mod5
6 files changed, 10 insertions, 5 deletions
diff --git a/gcc/m2/gm2-compiler/P0SyntaxCheck.bnf b/gcc/m2/gm2-compiler/P0SyntaxCheck.bnf
index 868484c..4e468bd 100644
--- a/gcc/m2/gm2-compiler/P0SyntaxCheck.bnf
+++ b/gcc/m2/gm2-compiler/P0SyntaxCheck.bnf
@@ -968,7 +968,7 @@ NamedOperand := '[' Ident ']' =:
AsmOperandName := [ NamedOperand ] =:
-AsmOperands := ConstExpression ':' AsmList [ ':' AsmList [ ':' TrashList ] ]
+AsmOperands := ConstExpression [ ':' AsmList [ ':' AsmList [ ':' TrashList ] ] ]
=:
AsmList := [ AsmElement ] { ',' AsmElement } =:
diff --git a/gcc/m2/gm2-compiler/P1Build.bnf b/gcc/m2/gm2-compiler/P1Build.bnf
index ac96ddb..42d034d 100644
--- a/gcc/m2/gm2-compiler/P1Build.bnf
+++ b/gcc/m2/gm2-compiler/P1Build.bnf
@@ -1048,7 +1048,7 @@ NamedOperand := '[' Ident ']' =:
AsmOperandName := [ NamedOperand ] =:
-AsmOperands := ConstExpression ':' AsmList [ ':' AsmList [ ':' TrashList ] ]
+AsmOperands := ConstExpression [ ':' AsmList [ ':' AsmList [ ':' TrashList ] ] ]
=:
AsmList := [ AsmElement ] { ',' AsmElement } =:
diff --git a/gcc/m2/gm2-compiler/P2Build.bnf b/gcc/m2/gm2-compiler/P2Build.bnf
index e3db5f0..86fbe15 100644
--- a/gcc/m2/gm2-compiler/P2Build.bnf
+++ b/gcc/m2/gm2-compiler/P2Build.bnf
@@ -1257,7 +1257,7 @@ NamedOperand := '[' Ident ']' =:
AsmOperandName := [ NamedOperand ] =:
-AsmOperands := ConstExpression ':' AsmList [ ':' AsmList [ ':' TrashList ] ]
+AsmOperands := ConstExpression [ ':' AsmList [ ':' AsmList [ ':' TrashList ] ] ]
=:
AsmList := [ AsmElement ] { ',' AsmElement } =:
diff --git a/gcc/m2/gm2-compiler/PCBuild.bnf b/gcc/m2/gm2-compiler/PCBuild.bnf
index 263ac9b..2731e89 100644
--- a/gcc/m2/gm2-compiler/PCBuild.bnf
+++ b/gcc/m2/gm2-compiler/PCBuild.bnf
@@ -1292,7 +1292,7 @@ NamedOperand := '[' Ident ']' =:
AsmOperandName := [ NamedOperand ] =:
-AsmOperands := ConstExpression ':' AsmList [ ':' AsmList [ ':' TrashList ] ]
+AsmOperands := ConstExpression [ ':' AsmList [ ':' AsmList [ ':' TrashList ] ] ]
=:
AsmList := [ AsmElement ] { ',' AsmElement } =:
diff --git a/gcc/m2/gm2-compiler/PHBuild.bnf b/gcc/m2/gm2-compiler/PHBuild.bnf
index 55f4e90..5893852 100644
--- a/gcc/m2/gm2-compiler/PHBuild.bnf
+++ b/gcc/m2/gm2-compiler/PHBuild.bnf
@@ -1246,7 +1246,7 @@ NamedOperand := '[' Ident ']' =:
AsmOperandName := [ NamedOperand ] =:
-AsmOperands := ConstExpression ':' AsmList [ ':' AsmList [ ':' TrashList ] ]
+AsmOperands := ConstExpression [ ':' AsmList [ ':' AsmList [ ':' TrashList ] ] ]
=:
AsmList := [ AsmElement ] { ',' AsmElement } =:
diff --git a/gcc/testsuite/gm2/extensions/asm/pass/conststr.mod b/gcc/testsuite/gm2/extensions/asm/pass/conststr.mod
new file mode 100644
index 0000000..bbe6939
--- /dev/null
+++ b/gcc/testsuite/gm2/extensions/asm/pass/conststr.mod
@@ -0,0 +1,5 @@
+MODULE conststr ;
+
+BEGIN
+ ASM VOLATILE ("")
+END conststr.