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

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

https://gcc.gnu.org/g:52405b14b7e6a8d13ac53525a341ebfd27ef67cc

commit r13-7633-g52405b14b7e6a8d13ac53525a341ebfd27ef67cc
Author: Gaius Mulley <gaiusm...@gmail.com>
Date:   Fri Jul 28 19:27:18 2023 +0100

    PR modula2/109810 ICE fix when an array is assigned by a larger string

    This patch fixes an ICE when an array variable is assigned with
    a string which exceeds the array size.  It improves the accuracy
    of the virtual token used to indicate the error message.

    gcc/m2/ChangeLog:

            PR modula2/109810
            * gm2-compiler/M2ALU.mod (ConvertConstToType): Use
            PrepareCopyString in place of DoCopyString.
            * gm2-compiler/M2GenGCC.def (DoCopyString): Rename to ...
            (PrepareCopyString): ... this.
            * gm2-compiler/M2GenGCC.mod (CodeStatement): Call CodeReturnValue
            with a single parameter.  Call CodeXIndr with a single parameter.
            (CodeReturnValue): Remove parameters and replace with a single
            quadno.  Reimplement using PrepareCopyString.  Issue error
            if the string exceeds designator space.
            (DoCopyString): Reimplement and rename to ...
            (PrepareCopyString): ... this.
            (CodeXIndr): Remove parameters and replace with a single
            quadno.  Reimplement using PrepareCopyString.  Issue error
            if the string exceeds designator space.
            (CodeBecomes): Remove parameters and replace with a single
            quadno.  Reimplement using PrepareCopyString.  Issue error
            if the string exceeds designator space.
            * gm2-compiler/M2Quads.def (BuildReturn): Rename parameter to
            tokreturn.
            * gm2-compiler/M2Quads.mod (BuildReturn): Rename parameter to
            tokreturn.  Rename tokno to tokcombined.

    gcc/testsuite/ChangeLog:

            PR modula2/109810
            * gm2/pim/fail/highice.mod: New test.

    (cherry picked from commit c787f593e62869ae0b230949b4791f4f3a26e50e)

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

Reply via email to