]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Fix ICE in aarch64_add_offset_1_temporaries [PR100302]
authorJakub Jelinek <jakub@redhat.com>
Thu, 29 Apr 2021 09:34:50 +0000 (11:34 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 4 May 2021 12:26:15 +0000 (14:26 +0200)
In PR94121 I've changed aarch64_add_offset_1 to use absu_hwi instead of
abs_hwi because offset can be HOST_WIDE_INT_MIN.  As can be seen with
the testcase below, aarch64_add_offset_1_temporaries suffers from the same
problem and should be in sync with aarch64_add_offset_1, i.e. for
HOST_WIDE_INT_MIN it needs a temporary.

2021-04-29  Jakub Jelinek  <jakub@redhat.com>

PR target/100302
* config/aarch64/aarch64.c (aarch64_add_offset_1_temporaries): Use
absu_hwi instead of abs_hwi.

(cherry picked from commit 1bb3e2c0ce6ed363c72caf814a6ba6d7b17c3e0a)

gcc/config/aarch64/aarch64.c

index c1827beeaf776890a5d31a7a4e57f0dfb53703ba..4ad73220337f53dcdc05dad210c31ca37e9e9887 100644 (file)
@@ -2566,7 +2566,7 @@ aarch64_mov128_immediate (rtx imm)
 static unsigned int
 aarch64_add_offset_1_temporaries (HOST_WIDE_INT offset)
 {
-  return abs_hwi (offset) < 0x1000000 ? 0 : 1;
+  return absu_hwi (offset) < 0x1000000 ? 0 : 1;
 }
 
 /* A subroutine of aarch64_add_offset.  Set DEST to SRC + OFFSET for