]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR modula2/109264 Bugfix resolve opaque types containing sets
authorGaius Mulley <gaiusmod2@gmail.com>
Thu, 23 Mar 2023 16:37:11 +0000 (16:37 +0000)
committerGaius Mulley <gaiusmod2@gmail.com>
Thu, 23 Mar 2023 16:37:11 +0000 (16:37 +0000)
commit5ededfa5b23781c3be6fcf6bb373418aa8bd6541
tree4f1e0c0a7bbab2ca8a11f962148a9b45e5b1a193
parent41ade3399bd1ec9927be1bb818965831232eda4b
PR modula2/109264 Bugfix resolve opaque types containing sets

Resolve opaque type handling.  The bug is caused by the compiler
attempting to resolve the meta types of a constant constructor.
It incorrectly attempts to get the type on an enumeration type
(resulting in NulSym) which causes the meta resolver to spin.
Some PHBuild rules (building records need to be copied from P3Build
so that hidden types are resolved in order across the compile.

gcc/m2/ChangeLog:

PR modula2/109264
* gm2-compiler/M2Quads.mod (BuildConstFunctionCall): Comment
out ErrorString in debugging block.
(BuildConstructorStart): Replace Assert with a call to
MetaErrorT3.  Import MetaErrorT3.
* gm2-compiler/PCSymBuild.mod (buildConstFunction): Rename
local variables.
(WalkFunctionParam): Remove test for IsEnumeration when
resolving MIN or MAX parameters.
* gm2-compiler/PHBuild.bnf (BlockAssert): New procedure.
(ErrorArrayat): New procedure.
(Expect): Renamed parameter t to tok.
(PushQualident): New rule.
(ConstSetOrQualidentOrFunction): Force AutoOn.
(TypeDeclaration): Add debugging assert.
(SimpleType): Add debugging assert.
(DefaultRecordAttributes): New rule (and bugfix).
(FieldPragmaExpression): New rule (and bugfix).
(PragmaConstExpression): New rule (and bugfix).
(SetOrDesignatorOrFunction): Add debugging assert.
(Block): Add debugging assert.
* gm2-gcc/m2expr.cc (m2expr_ConstantExpressionWarning): int
to bool.
* gm2-gcc/m2expr.h (m2expr_TreeOverflow): int to bool.
(m2expr_GetBooleanTrue): Remove.
(m2expr_GetBooleanFalse): Remove.
* gm2-gcc/m2options.h (M2Options_SetStatistics): Replace
int with bool.

gcc/testsuite/ChangeLog:

PR modula2/109264
* gm2/iso/extended-opaque/pass/iso-extended-opaque-pass.exp:
New test.
* gm2/iso/extended-opaque/pass/stressset.def: New test.
* gm2/iso/extended-opaque/pass/stressset.mod: New test.
* gm2/iso/extended-opaque/pass/testset.mod: New test.
* gm2/projects/iso/small/run/pass/iso-extended-opaque-run-pass.exp:
New test.
* gm2/projects/iso/small/run/pass/stressset.def: New test.
* gm2/projects/iso/small/run/pass/stressset.mod: New test.
* gm2/projects/iso/small/run/pass/test1.mod: New test.
* gm2/projects/iso/small/run/pass/testlib.def: New test.
* gm2/projects/iso/small/run/pass/testlib.mod: New test.
* gm2/projects/iso/small/run/pass/testset.mod: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
17 files changed:
gcc/m2/gm2-compiler/M2Quads.mod
gcc/m2/gm2-compiler/PCSymBuild.mod
gcc/m2/gm2-compiler/PHBuild.bnf
gcc/m2/gm2-gcc/m2expr.cc
gcc/m2/gm2-gcc/m2expr.h
gcc/m2/gm2-gcc/m2options.h
gcc/testsuite/gm2/iso/extended-opaque/pass/iso-extended-opaque-pass.exp [new file with mode: 0755]
gcc/testsuite/gm2/iso/extended-opaque/pass/stressset.def [new file with mode: 0644]
gcc/testsuite/gm2/iso/extended-opaque/pass/stressset.mod [new file with mode: 0644]
gcc/testsuite/gm2/iso/extended-opaque/pass/testset.mod [new file with mode: 0644]
gcc/testsuite/gm2/projects/iso/small/run/pass/iso-extended-opaque-run-pass.exp [new file with mode: 0755]
gcc/testsuite/gm2/projects/iso/small/run/pass/stressset.def [new file with mode: 0644]
gcc/testsuite/gm2/projects/iso/small/run/pass/stressset.mod [new file with mode: 0644]
gcc/testsuite/gm2/projects/iso/small/run/pass/test1.mod [new file with mode: 0644]
gcc/testsuite/gm2/projects/iso/small/run/pass/testlib.def [new file with mode: 0644]
gcc/testsuite/gm2/projects/iso/small/run/pass/testlib.mod [new file with mode: 0644]
gcc/testsuite/gm2/projects/iso/small/run/pass/testset.mod [new file with mode: 0644]