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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tamar Christina <tnfch...@gcc.gnu.org>:

https://gcc.gnu.org/g:0f801e0b6cc9f67c9a8983127e23161f6025c5b6

commit r11-4453-g0f801e0b6cc9f67c9a8983127e23161f6025c5b6
Author: Tamar Christina <tamar.christ...@arm.com>
Date:   Tue Oct 27 16:30:31 2020 +0000

    AArch64: Fix overflow in memcopy expansion on aarch64.

    Currently the inline memcpy expansion code for AArch64 is using a signed
int
    to hold the number of elements to copy.  When you giver give it a value
larger
    than INT_MAX it will overflow.

    The overflow causes the maximum number of instructions we want to expand to
    check to fail since this assumes an unsigned number.

    This patch changes the maximum isns arithmetic to be unsigned
HOST_WIDE_INT.

    note that the calculation *must* remained signed as the memcopy issues
    overlapping unaligned copies.  This means the pointer must be moved back
and
    so you need signed arithmetic.

    gcc/ChangeLog:

            PR target/97535
            * config/aarch64/aarch64.c (aarch64_expand_cpymem): Use unsigned
            arithmetic in check.

    gcc/testsuite/ChangeLog:

            PR target/97535
            * gcc.target/aarch64/pr97535.c: New test.

Reply via email to