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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gaius Mulley <[email protected]>:

https://gcc.gnu.org/g:9dbf90fc0876b6b33dbe695fd1ab62976cc7178b

commit r16-8685-g9dbf90fc0876b6b33dbe695fd1ab62976cc7178b
Author: Gaius Mulley <[email protected]>
Date:   Wed Apr 15 18:34:23 2026 +0100

    PR modula2/124081 Bugfix ICE in expand_expr_real_2 with a record

    This patch fixes an ICE which occurs when attempting to create a
    set using a subrange from a record field.  The fix ensures that the
    record field is copied to a temporary prior to the set construction.

    gcc/m2/ChangeLog:

            PR modula2/124081
            * gm2-compiler/M2Quads.mod (SafeCheckWithField): New procedure.
            (BuildInclRange): Reimplement.
            (AddFieldTo): Ditto.
            (BuildComponentValue): Ditto.

    gcc/testsuite/ChangeLog:

            PR modula2/124081
            * gm2/iso/run/pass/setcons.mod: New test.
            * gm2/iso/run/pass/setcons2.mod: New test.
            * gm2/iso/run/pass/setcons3.mod: New test.
            * gm2/iso/run/pass/setcons4.mod: New test.
            * gm2/iso/run/pass/setcons5.mod: New test.

    Signed-off-by: Gaius Mulley <[email protected]>

Reply via email to