https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109264
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Gaius Mulley <ga...@gcc.gnu.org>: https://gcc.gnu.org/g:5ededfa5b23781c3be6fcf6bb373418aa8bd6541 commit r13-6835-g5ededfa5b23781c3be6fcf6bb373418aa8bd6541 Author: Gaius Mulley <gaiusm...@gmail.com> Date: Thu Mar 23 16:37:11 2023 +0000 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 <gaiusm...@gmail.com>