https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120117
Bug ID: 120117 Summary: ICE when attempting to obtain the MAX of an aliased set type. Product: gcc Version: 16.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: modula2 Assignee: gaius at gcc dot gnu.org Reporter: gaius at gcc dot gnu.org Target Milestone: --- Consider the following code: $ cat highbit.mod MODULE highbit ; FROM libc IMPORT printf ; TYPE set = BITSET ; CONST HighBit = MAX (set) ; BEGIN printf ("the MAX (set) = %d\n", HighBit) END highbit. $ gm2 highbit.mod cc1gm2: internal compiler error: in libc_abort, at m2/mc-boot-ch/Glibc.c:173 0x2e96741 internal_error(char const*, ...) ../../gcc/diagnostic-global-context.cc:517 0x2e632f4 fancy_abort(char const*, int, char const*) ../../gcc/diagnostic.cc:1748 0x546a4c libc_abort ../../gcc/m2/mc-boot-ch/Glibc.c:173 0x53bf70 M2RTS_HALT m2/gm2-libs-boot/M2RTS.c:476 0x537e21 Indexing_GetIndice m2/gm2-libs-boot/Indexing.c:385 0x49ff55 GetQF m2/gm2-compiler-boot/M2Quads.c:5651 0x4b31fe M2Quads_SubQuad m2/gm2-compiler-boot/M2Quads.c:17304 0x48220d RemoveQuad m2/gm2-compiler-boot/M2GenGCC.c:4795 0x4821ad FoldBecomes m2/gm2-compiler-boot/M2GenGCC.c:4767 0x48ebf6 M2GenGCC_ResolveConstantExpressions m2/gm2-compiler-boot/M2GenGCC.c:10831 0x47cbae M2GCCDeclare_FoldConstants m2/gm2-compiler-boot/M2GCCDeclare.c:8551 0x463872 M2BasicBlock_ForeachBasicBlockDo m2/gm2-compiler-boot/M2BasicBlock.c:500 0x474e03 DeclareTypesConstantsProceduresInRange m2/gm2-compiler-boot/M2GCCDeclare.c:4443 0x4c53e0 M2Scope_ForeachScopeBlockDo3 m2/gm2-compiler-boot/M2Scope.c:703 0x47502e DeclareTypesConstantsProcedures m2/gm2-compiler-boot/M2GCCDeclare.c:4545 0x475254 StartDeclareModuleScopeSeparate m2/gm2-compiler-boot/M2GCCDeclare.c:4636 0x475498 StartDeclareModuleScope m2/gm2-compiler-boot/M2GCCDeclare.c:4714 0x47cbeb M2GCCDeclare_StartDeclareScope m2/gm2-compiler-boot/M2GCCDeclare.c:8577 0x46a4b1 DoModuleDeclare m2/gm2-compiler-boot/M2Code.c:264 0x46aa61 M2Code_Code m2/gm2-compiler-boot/M2Code.c:470