-
- Downloads
PR modula2/114055 improve error message when checking the BY constant
The fix marks a constant created during the default BY clause of the
FOR loop as internal. The type checker will always return true if
checking against an internal const.
gcc/m2/ChangeLog:
PR modula2/114055
* gm2-compiler/M2Check.mod (Import): IsConstLitInternal and
IsConstLit.
(isInternal): New procedure function.
(doCheck): Test for isInternal in either operand and early
return true.
* gm2-compiler/M2Quads.mod (PushOne): Rewrite with extra
parameter internal.
(BuildPseudoBy): Add TRUE parameter to PushOne call.
(BuildIncProcedure): Add FALSE parameter to PushOne call.
(BuildDecProcedure): Add FALSE parameter to PushOne call.
* gm2-compiler/M2Range.mod (ForLoopBeginTypeCompatible):
Uncomment code and tidy up error string.
* gm2-compiler/SymbolTable.def (PutConstLitInternal):
New procedure.
(IsConstLitInternal): New procedure function.
* gm2-compiler/SymbolTable.mod (PutConstLitInternal):
New procedure.
(IsConstLitInternal): New procedure function.
(SymConstLit): New field IsInternal.
(CreateConstLit): Initialize IsInternal to FALSE.
gcc/testsuite/ChangeLog:
PR modula2/114055
* gm2/pim/fail/forloopby.mod: New test.
* gm2/pim/pass/forloopby2.mod: New test.
Signed-off-by:
Gaius Mulley <gaiusmod2@gmail.com>
Showing
- gcc/m2/gm2-compiler/M2Check.mod 27 additions, 1 deletiongcc/m2/gm2-compiler/M2Check.mod
- gcc/m2/gm2-compiler/M2Quads.mod 21 additions, 8 deletionsgcc/m2/gm2-compiler/M2Quads.mod
- gcc/m2/gm2-compiler/M2Range.mod 1 addition, 3 deletionsgcc/m2/gm2-compiler/M2Range.mod
- gcc/m2/gm2-compiler/SymbolTable.def 19 additions, 0 deletionsgcc/m2/gm2-compiler/SymbolTable.def
- gcc/m2/gm2-compiler/SymbolTable.mod 51 additions, 1 deletiongcc/m2/gm2-compiler/SymbolTable.mod
- gcc/testsuite/gm2/pim/fail/forloopby.mod 17 additions, 0 deletionsgcc/testsuite/gm2/pim/fail/forloopby.mod
- gcc/testsuite/gm2/pim/pass/forloopby2.mod 18 additions, 0 deletionsgcc/testsuite/gm2/pim/pass/forloopby2.mod
Loading
Please register or sign in to comment