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

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

https://gcc.gnu.org/g:cfe21668f3a7a0f07fa1e79ef2561a107a09a67d

commit r14-11089-gcfe21668f3a7a0f07fa1e79ef2561a107a09a67d
Author: Gaius Mulley <gaiusm...@gmail.com>
Date:   Sat Dec 14 11:46:57 2024 +0000

    [PATCH] PR modula2/117120: case ch with a nul char constant causes ICE

    This patch fixes the ICE caused when a case clause contains
    a character constant ''.  The fix was to walk the caselist and
    convert any 0 length string into a char constant of value 0.

    gcc/m2/ChangeLog:

            PR modula2/117120
            * gm2-compiler/M2CaseList.mod (CaseBoundsResolved): Rewrite.
            (ConvertNulStr2NulChar): New procedure function.
            (NulStr2NulChar): Ditto.
            (GetCaseExpression): Ditto.
            (OverlappingCaseBound): Rewrite.
            * gm2-compiler/M2GCCDeclare.mod (CheckResolveSubrange): Allow
            '' to be used as the subrange low limit.
            * gm2-compiler/M2GenGCC.mod (FoldConvert): Rewrite.
            (PopKindTree): Ditto.
            (BuildHighFromString): Reformat.
            * gm2-compiler/SymbolTable.mod (PushConstString): Add test for
            length 0 and PushChar (nul).

    gcc/testsuite/ChangeLog:

            PR modula2/117120
            * gm2/pim/pass/forloopnulchar.mod: New test.
            * gm2/pim/pass/nulcharcase.mod: New test.
            * gm2/pim/pass/nulcharvar.mod: New test.

    (cherry picked from commit e0ab8816ea53e2a343f7e945f4718172bff5ce95)

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

Reply via email to