https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120117

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Gaius Mulley
<ga...@gcc.gnu.org>:

https://gcc.gnu.org/g:61fada934e894c7fb4a1f1626ea0d0f1f1f1d2f4

commit r15-9677-g61fada934e894c7fb4a1f1626ea0d0f1f1f1d2f4
Author: Gaius Mulley <gaiusm...@gmail.com>
Date:   Tue May 13 19:42:39 2025 +0100

    [PATCH] 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.

    (cherry picked from commit bb83283e5c5c55eab7493a58c5e415aa56f5940c)

    Signed-off-by: Gaius Mulley <gaiusm...@gmail.com>

Reply via email to