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

--- Comment #1 from Icenowy Zheng <icenowy at aosc dot io> ---
The problem is found to be trying to expand a memcpy() call with fixed length
2181038080.

Handling of memcpy() expansion seem to be corrupted when len >= 2147483648. The
length is mod with 2147483648, and then forced to expand.

When a test program that contains a call to memcpy() with len 2147483648 is
tried, it is "expanded" to nothing.

The problematic thing seems to be aarch64_expand_cpymem() in master at
config/aarch64/aarch64.c (aarch64_expand_movmem() in GCC 9), in which the
variable n is declared with `int` (a 32-bit signed integer on both AArch64 LP64
and x86-64). Modify it to HOST_WIDE_INT seems to fix the problem.

Reply via email to