]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Fix another bug in aarch64_add_offset_1 [PR94121]
authorJakub Jelinek <jakub@redhat.com>
Fri, 13 Mar 2020 10:33:16 +0000 (11:33 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 17 Mar 2020 17:22:13 +0000 (18:22 +0100)
> I'm getting this ICE with -mabi=ilp32:
>
> during RTL pass: fwprop1
> /opt/gcc/gcc-20200312/gcc/testsuite/gcc.dg/pr94121.c: In function 'bar':
> /opt/gcc/gcc-20200312/gcc/testsuite/gcc.dg/pr94121.c:16:1: internal compiler error: in decompose, at rtl.h:2279

That is a preexisting issue, caused by another bug in the same function.
When mode is SImode and moffset is 0x80000000 (or anything else with the
bit 31 set), we need to sign-extend it.

2020-03-13  Jakub Jelinek  <jakub@redhat.com>

PR target/94121
* config/aarch64/aarch64.c (aarch64_add_offset_1): Use gen_int_mode
instead of GEN_INT.

gcc/ChangeLog
gcc/config/aarch64/aarch64.c

index f3ea4382378f8c5770be962b72b82f5585087836..52a760005d114db66cece2e6b8aa6dac254e521d 100644 (file)
@@ -1,6 +1,12 @@
 2020-03-17  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2020-03-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/94121
+       * config/aarch64/aarch64.c (aarch64_add_offset_1): Use gen_int_mode
+       instead of GEN_INT.
+
        2020-03-12  Jakub Jelinek  <jakub@redhat.com>
 
        * doc/tm.texi.in (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Change
index 5906b1492b8ad8469f1ccf9231cf98b170922e01..2b09f317978e26de07a6044f436c9c4072ef1f78 100644 (file)
@@ -2862,7 +2862,8 @@ aarch64_add_offset_1 (scalar_int_mode mode, rtx dest,
   if (emit_move_imm)
     {
       gcc_assert (temp1 != NULL_RTX || can_create_pseudo_p ());
-      temp1 = aarch64_force_temporary (mode, temp1, GEN_INT (moffset));
+      temp1 = aarch64_force_temporary (mode, temp1,
+                                      gen_int_mode (moffset, mode));
     }
   insn = emit_insn (offset < 0
                    ? gen_sub3_insn (dest, src, temp1)