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

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

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

commit r13-7168-ga1afdc6e2aa77d0a990e1a82aceeffc837b7e50c
Author: Gaius Mulley <gaiusm...@gmail.com>
Date:   Thu Apr 13 17:02:48 2023 +0100

    PR modula2/109496 Fix constant char parameter passing to an array of char

    This patch fixes PR modula2/109496 and PR modula2/109497.  The fix for
    PR modula2/109496 promotes a char constant to a string.  The PR
    modula2/109497 allows for constant chars to be added to form a string.
    The fixes for both PR's occur in M2GenGCC.mod and M2GCCDeclare.mod
    after the resolving of constant declarations.

    gcc/m2/ChangeLog:

            * gm2-compiler/M2ALU.def (PopChar): New procedure function.
            * gm2-compiler/M2ALU.mod (PopChar): New procedure function.
            * gm2-compiler/M2GCCDeclare.mod (PromoteToString): Detect
            a single constant char and build a C string.
            * gm2-compiler/M2GenGCC.mod (IsConstStr): New procedure
            function.
            (GetStr): New procedure function.
            (FoldAdd): Use IsConstStr.
            * gm2-compiler/M2Quads.mod: Formatting changes.
            * gm2-gcc/m2expr.cc (m2expr_GetCstInteger): New function.
            * gm2-gcc/m2expr.def (GetCstInteger): New procedure function.
            * gm2-gcc/m2expr.h (m2expr_GetCstInteger): New prototype.

    gcc/testsuite/ChangeLog:

            PR modula2/109497
            * gm2/pim/run/pass/addcharconst.mod: New test.
            PR modula2/109496
            * gm2/pim/run/pass/singlechar.mod: New test.

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

Reply via email to