https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120117
--- Comment #3 from GCC 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:bb83283e5c5c55eab7493a58c5e415aa56f5940c commit r16-392-gbb83283e5c5c55eab7493a58c5e415aa56f5940c Author: Gaius Mulley <gaiusm...@gmail.com> Date: Mon May 5 18:16:20 2025 +0100 PR modula2/120117: ICE when attempting to obtain the MAX of an aliased set type The ICE occurred because of a bug in M2GenGCC.mod:FoldBecomes which attempted to remove the same quadruple twice. Thereafter cc1gm2 generated an erroneous error type error as PCSymBuild did not skip an aliased set type. The type of the const was set incorrectly (as a set type) rather than the type of the set element. gcc/m2/ChangeLog: PR modula2/120117 * gm2-compiler/M2GenGCC.mod (FoldBecomes): Remove the call to RemoveQuad since this is performed by TypeCheckBecomes. * gm2-compiler/PCSymBuild.mod (buildConstFunction): Rewrite header comment. Check for a set or a type aliased set and appropriately skip type equivalences and obtain the element type. * gm2-compiler/SymbolTable.mod (PutConst): Add call to CheckBreak. gcc/testsuite/ChangeLog: PR modula2/120117 * gm2/pim/pass/highbit.mod: New test. * gm2/pim/pass/highbit2.mod: New test. Signed-off-by: Gaius Mulley <gaiusm...@gmail.com>