]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR modula2/120117: ICE when attempting to obtain the MAX of an aliased set type
authorGaius Mulley <gaiusmod2@gmail.com>
Mon, 5 May 2025 17:16:20 +0000 (18:16 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Mon, 5 May 2025 17:16:20 +0000 (18:16 +0100)
commitbb83283e5c5c55eab7493a58c5e415aa56f5940c
tree2afc824c6cb3661d78293134c795dede784209b9
parent7f285b7ad7cb89a9b29b52e0d25a7666dc9bd645
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 <gaiusmod2@gmail.com>
gcc/m2/gm2-compiler/M2GenGCC.mod
gcc/m2/gm2-compiler/PCSymBuild.mod
gcc/m2/gm2-compiler/SymbolTable.mod
gcc/testsuite/gm2/pim/pass/highbit.mod [new file with mode: 0644]
gcc/testsuite/gm2/pim/pass/highbit2.mod [new file with mode: 0644]