-
- Downloads
PR modula2/110174 Bugfixes to M2GenGCC.mod:CodeInline preventing an ICE
This patch calls skip_const_decl before chaining parameter values and
ensures that all strings passed to build_stmt (..., ASM_EXPR, ...) are
nul terminated. It also improves the accuracy of locations in
function calls and asm statements.
gcc/m2/
PR modula2/110174
* gm2-compiler/M2GCCDeclare.def (PromoteToCString): New procedure
function.
* gm2-compiler/M2GCCDeclare.mod (PromoteToCString): New procedure
function.
* gm2-compiler/M2GenGCC.mod (BuildTreeFromInterface): Call
skip_const_decl before chaining the parameter value.
Use PromoteToCString to ensure the string is nul terminated.
(CodeInline): Remove all parameters and replace with quad.
Use GetQuadOtok to get operand token numbers.
Remove call to DeclareConstant and replace it with PromoteToCString.
* gm2-compiler/M2Quads.def (BuildInline): Rename into ...
(BuildAsm): ... this.
* gm2-compiler/M2Quads.mod: (BuildInline): Rename into ...
(BuildAsm): ... this.
(BuildAsmElement): Add debugging.
* gm2-compiler/P1Build.bnf: Remove import of BuildInline.
* gm2-compiler/P2Build.bnf: Remove import of BuildInline.
* gm2-compiler/P3Build.bnf: Remove import of BuildInline and
import BuildAsm.
* gm2-compiler/PHBuild.bnf: Remove import of BuildInline.
* gm2-libs-iso/SysClock.mod (foo): Remove.
* gm2-libs/FIO.mod (BufferedRead): Rename parameter a to dest.
Rename variable t to src.
* m2pp.cc (pf): Correct block comment.
(pe): Correct block comment.
(m2pp_asm_expr): New function.
(m2pp_statement): Call m2pp_asm_expr.
gcc/testsuite/
PR modula2/110174
* gm2/pim/pass/program2.mod: Remove import of BuildInline.
* gm2/extensions/asm/fail/extensions-asm-fail.exp: New test.
* gm2/extensions/asm/fail/stressreturn.mod: New test.
* gm2/extensions/asm/pass/extensions-asm-pass.exp: New test.
* gm2/extensions/asm/pass/fooasm.mod: New test.
Signed-off-by:
Gaius Mulley <gaiusmod2@gmail.com>
Showing
- gcc/m2/gm2-compiler/M2GCCDeclare.def 11 additions, 12 deletionsgcc/m2/gm2-compiler/M2GCCDeclare.def
- gcc/m2/gm2-compiler/M2GCCDeclare.mod 27 additions, 0 deletionsgcc/m2/gm2-compiler/M2GCCDeclare.mod
- gcc/m2/gm2-compiler/M2GenGCC.mod 46 additions, 27 deletionsgcc/m2/gm2-compiler/M2GenGCC.mod
- gcc/m2/gm2-compiler/M2Quads.def 10 additions, 10 deletionsgcc/m2/gm2-compiler/M2Quads.def
- gcc/m2/gm2-compiler/M2Quads.mod 26 additions, 13 deletionsgcc/m2/gm2-compiler/M2Quads.mod
- gcc/m2/gm2-compiler/P1Build.bnf 1 addition, 2 deletionsgcc/m2/gm2-compiler/P1Build.bnf
- gcc/m2/gm2-compiler/P2Build.bnf 0 additions, 1 deletiongcc/m2/gm2-compiler/P2Build.bnf
- gcc/m2/gm2-compiler/P3Build.bnf 20 additions, 18 deletionsgcc/m2/gm2-compiler/P3Build.bnf
- gcc/m2/gm2-compiler/PHBuild.bnf 0 additions, 1 deletiongcc/m2/gm2-compiler/PHBuild.bnf
- gcc/m2/gm2-libs-iso/SysClock.mod 0 additions, 10 deletionsgcc/m2/gm2-libs-iso/SysClock.mod
- gcc/m2/gm2-libs/FIO.mod 24 additions, 24 deletionsgcc/m2/gm2-libs/FIO.mod
- gcc/m2/m2pp.cc 35 additions, 4 deletionsgcc/m2/m2pp.cc
- gcc/testsuite/gm2/extensions/asm/fail/extensions-asm-fail.exp 37 additions, 0 deletions...testsuite/gm2/extensions/asm/fail/extensions-asm-fail.exp
- gcc/testsuite/gm2/extensions/asm/fail/stressreturn.mod 14 additions, 0 deletionsgcc/testsuite/gm2/extensions/asm/fail/stressreturn.mod
- gcc/testsuite/gm2/extensions/asm/pass/extensions-asm-pass.exp 37 additions, 0 deletions...testsuite/gm2/extensions/asm/pass/extensions-asm-pass.exp
- gcc/testsuite/gm2/extensions/asm/pass/fooasm.mod 13 additions, 0 deletionsgcc/testsuite/gm2/extensions/asm/pass/fooasm.mod
- gcc/testsuite/gm2/pim/pass/program2.mod 1 addition, 2 deletionsgcc/testsuite/gm2/pim/pass/program2.mod
Loading
Please register or sign in to comment