[Bug target/97535] [9/10 Regression] On AArch64 memcpy expansion cannot handle length > 32-bit signed int max

2020-11-17 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97535

Tamar Christina  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #17 from Tamar Christina  ---
Fixed on master and all branches still open.

[Bug target/97535] [9/10 Regression] On AArch64 memcpy expansion cannot handle length > 32-bit signed int max

2020-11-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97535

--- Comment #16 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Tamar Christina
:

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

commit r8-10626-gff3bb57646fb49090ce84b05bda5003b8f33fc07
Author: Tamar Christina 
Date:   Tue Nov 17 12:53:08 2020 +

AArch64: Fix overflow in memcopy expansion on aarch64.

This a partial backport for 0f801e0b6cc9f67c9a8983127e23161f6025c5b6 which
fixes
a truncation error for the inline memcopy on AArch64 on GCC-8.

gcc/ChangeLog:

PR target/97535
* config/aarch64/aarch64.c (aarch64_expand_movme): Use
unsigned HOST_WIDE_INT.

gcc/testsuite/ChangeLog:

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

[Bug target/97535] [9/10 Regression] On AArch64 memcpy expansion cannot handle length > 32-bit signed int max

2020-11-17 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97535

--- Comment #15 from Tamar Christina  ---
Hmm indeed. I only saw it was doing unsigned arithmetic.  I'll patch that one
too.

[Bug target/97535] [9/10 Regression] On AArch64 memcpy expansion cannot handle length > 32-bit signed int max

2020-11-17 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97535

Tamar Christina  changed:

   What|Removed |Added

 Resolution|FIXED   |---
 Status|RESOLVED|ASSIGNED

--- Comment #14 from Tamar Christina  ---
Hmm indeed. I only saw it was doing unsigned arithmetic.  I'll patch that one
too.

[Bug target/97535] [9/10 Regression] On AArch64 memcpy expansion cannot handle length > 32-bit signed int max

2020-11-17 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97535

--- Comment #13 from rguenther at suse dot de  ---
On Tue, 17 Nov 2020, tnfchris at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97535
> 
> Tamar Christina  changed:
> 
>What|Removed |Added
> 
>  Resolution|--- |FIXED
>  Status|ASSIGNED|RESOLVED
> 
> --- Comment #12 from Tamar Christina  ---
> Fixed and backported to GCC 10,9. Could not reproduce on 8 which has a
> different algorithm.

But aarch64_expand_movmem has the same problem:

bool
aarch64_expand_movmem (rtx *operands)
{
  unsigned int n;
...
  n = UINTVAL (operands[2]);

should use unsigned HOST_WIDE_INT.

[Bug target/97535] [9/10 Regression] On AArch64 memcpy expansion cannot handle length > 32-bit signed int max

2020-11-17 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97535

Tamar Christina  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #12 from Tamar Christina  ---
Fixed and backported to GCC 10,9. Could not reproduce on 8 which has a
different algorithm.

[Bug target/97535] [9/10 Regression] On AArch64 memcpy expansion cannot handle length > 32-bit signed int max

2020-11-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97535

--- Comment #11 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Tamar Christina
:

https://gcc.gnu.org/g:98ba03ffe0b9f37b4916ce6238fad754e00d720b

commit r10-9035-g98ba03ffe0b9f37b4916ce6238fad754e00d720b
Author: Tamar Christina 
Date:   Wed Oct 28 19:13:27 2020 +

AArch64: Skip test for pr97535 on ILP32 since it can't express the range.

I am excluding the test from ILP32 since the goal of the test is to test
truncations of large numbers above INT_MAX.

gcc/testsuite/ChangeLog:

PR target/97535
* gcc.target/aarch64/pr97535.c: Exclude ILP32.

(cherry picked from commit 3dcd47389b16f48dcf5512b9ebba15af5c0be948)

[Bug target/97535] [9/10 Regression] On AArch64 memcpy expansion cannot handle length > 32-bit signed int max

2020-11-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97535

--- Comment #10 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Tamar Christina
:

https://gcc.gnu.org/g:7e785f4c7643dbf5c4ae8cf02e2c148429adbfcf

commit r9-9053-g7e785f4c7643dbf5c4ae8cf02e2c148429adbfcf
Author: Tamar Christina 
Date:   Wed Oct 28 19:13:27 2020 +

AArch64: Skip test for pr97535 on ILP32 since it can't express the range.

I am excluding the test from ILP32 since the goal of the test is to test
truncations of large numbers above INT_MAX.

gcc/testsuite/ChangeLog:

PR target/97535
* gcc.target/aarch64/pr97535.c: Exclude ILP32.

(cherry picked from commit 3dcd47389b16f48dcf5512b9ebba15af5c0be948)

[Bug target/97535] [9/10 Regression] On AArch64 memcpy expansion cannot handle length > 32-bit signed int max

2020-11-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97535

--- Comment #9 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Tamar Christina
:

https://gcc.gnu.org/g:9d65095e72502c12903e202cfe2e1fc58140522a

commit r9-9052-g9d65095e72502c12903e202cfe2e1fc58140522a
Author: Tamar Christina 
Date:   Tue Oct 27 16:30:31 2020 +

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.

(cherry picked from commit 0f801e0b6cc9f67c9a8983127e23161f6025c5b6)

[Bug target/97535] [9/10 Regression] On AArch64 memcpy expansion cannot handle length > 32-bit signed int max

2020-11-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97535

--- Comment #8 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Tamar Christina
:

https://gcc.gnu.org/g:886964a78aa89ef3c15e69a7b4b96c55d51ea812

commit r10-9034-g886964a78aa89ef3c15e69a7b4b96c55d51ea812
Author: Tamar Christina 
Date:   Tue Nov 17 10:19:20 2020 +

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.  The type
can
stay 32-bits since the number of instructions we are allowed to expand to
are at most 8 which is far below what you could fit in an unsigned 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.

[Bug target/97535] [9/10 Regression] On AArch64 memcpy expansion cannot handle length > 32-bit signed int max

2020-11-09 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97535

Richard Biener  changed:

   What|Removed |Added

   Keywords||wrong-code
   Priority|P3  |P2
 CC||rguenth at gcc dot gnu.org
   Target Milestone|--- |9.4

[Bug target/97535] [9/10 Regression] On AArch64 memcpy expansion cannot handle length > 32-bit signed int max

2020-10-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97535

--- Comment #7 from CVS Commits  ---
The master branch has been updated by Tamar Christina :

https://gcc.gnu.org/g:3dcd47389b16f48dcf5512b9ebba15af5c0be948

commit r11-4496-g3dcd47389b16f48dcf5512b9ebba15af5c0be948
Author: Tamar Christina 
Date:   Wed Oct 28 19:13:27 2020 +

AArch64: Skip test for pr97535 on ILP32 since it can't express the range.

I am excluding the test from ILP32 since the goal of the test is to test
truncations of large numbers above INT_MAX.

gcc/testsuite/ChangeLog:

PR target/97535
* gcc.target/aarch64/pr97535.c: Exclude ILP32.

[Bug target/97535] [9/10 Regression] On AArch64 memcpy expansion cannot handle length > 32-bit signed int max

2020-10-27 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97535

Tamar Christina  changed:

   What|Removed |Added

Summary|[9/10/11 Regression] On |[9/10 Regression] On
   |AArch64 memcpy expansion|AArch64 memcpy expansion
   |cannot handle length >  |cannot handle length >
   |32-bit signed int max   |32-bit signed int max
 Status|NEW |ASSIGNED

--- Comment #6 from Tamar Christina  ---
fixed in trunk, will backport in a few days.