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

--- Comment #3 from GCC 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:1b43154b90be6a2f691b98d4e395c07ac6c7045c

commit r15-7845-g1b43154b90be6a2f691b98d4e395c07ac6c7045c
Author: Gaius Mulley <gaiusm...@gmail.com>
Date:   Wed Mar 5 23:01:45 2025 +0000

    PR modula2/118998 Rotate of a packetset causes different types to binary
operator error

    This patch allow a packedset to be rotated by the system module intrinsic
    procedure function.  It ensures that both operands to the tree rotate are
    of the same type.  In turn the result will be the same type and the
    assignment into the designator (of the same set type) will succeed.

    gcc/m2/ChangeLog:

            PR modula2/118998
            * gm2-gcc/m2expr.cc (m2expr_BuildLRotate): Convert nBits
            to the return type.
            (m2expr_BuildRRotate): Ditto.
            (m2expr_BuildLogicalRotate): Convert op3 to an integer type.
            Replace op3 aith rotateCount.
            Negate rotateCount if it is negative and call rotate right.
            * gm2-gcc/m2pp.cc (m2pp_bit_and_expr): New function.
            (m2pp_binary_function): Ditto.
            (m2pp_simple_expression): BIT_AND_EXPR new case clause.
            LROTATE_EXPR ditto.
            RROTATE_EXPR ditto.

    gcc/testsuite/ChangeLog:

            PR modula2/118998
            * gm2/iso/pass/testrotate.mod: New test.
            * gm2/pim/fail/tinyconst.mod: New test.
            * gm2/sets/run/pass/simplepacked.mod: New test.

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

Reply via email to