aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorTamar Christina <tamar.christina@arm.com>2020-10-27 16:30:31 +0000
committerTamar Christina <tamar.christina@arm.com>2020-10-27 16:59:12 +0000
commit0f801e0b6cc9f67c9a8983127e23161f6025c5b6 (patch)
treed2db0ba0a2b09c0067459200b9c9103e10dc964e /gcc/fortran/resolve.c
parent8eb8dcac6ed265d9da2d1971ff5a47e04fbf9fb5 (diff)
downloadgcc-0f801e0b6cc9f67c9a8983127e23161f6025c5b6.zip
gcc-0f801e0b6cc9f67c9a8983127e23161f6025c5b6.tar.gz
gcc-0f801e0b6cc9f67c9a8983127e23161f6025c5b6.tar.bz2
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.
Diffstat (limited to 'gcc/fortran/resolve.c')
0 files changed, 0 insertions, 0 deletions