]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport for PR91289
authorSegher Boessenkool <segher@kernel.crashing.org>
Tue, 5 Nov 2019 17:17:03 +0000 (18:17 +0100)
committerSegher Boessenkool <segher@gcc.gnu.org>
Tue, 5 Nov 2019 17:17:03 +0000 (18:17 +0100)
Backport from trunk
2019-10-26  Segher Boessenkool  <segher@kernel.crashing.org>

PR target/91289
* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Don't add an
immediate to r0; use r11 instead.  Save and restore r11 to r0 around
this.

From-SVN: r277855

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index d84440809a70167c50088e4fddc77748dcf5bf67..47d9b3e66270200e7a0a820614d2747ed157e710 100644 (file)
@@ -1,3 +1,13 @@
+2019-11-05  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       Backport from trunk
+       2019-10-26  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       PR target/91289
+       * config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Don't add an
+       immediate to r0; use r11 instead.  Save and restore r11 to r0 around
+       this.
+
 2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>
 
        Backport from mainline
index 2a8932d80aaaba172d0bc98b8453c59654d800cc..a670096145b9dc5f256edf5aad0111a819a93244 100644 (file)
@@ -25833,10 +25833,14 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, rtx copy_reg, int copy_off)
                                                    stack_limit_rtx,
                                                    GEN_INT (size)));
 
-         emit_insn (gen_elf_high (tmp_reg, toload));
-         emit_insn (gen_elf_low (tmp_reg, tmp_reg, toload));
-         emit_insn (gen_cond_trap (LTU, stack_reg, tmp_reg,
-                                   const0_rtx));
+         /* We cannot use r0 with elf_low.  Lamely solve this problem by
+            moving registers around.  */
+         rtx r11_reg = gen_rtx_REG (Pmode, 11);
+         emit_move_insn (tmp_reg, r11_reg);
+         emit_insn (gen_elf_high (r11_reg, toload));
+         emit_insn (gen_elf_low (r11_reg, r11_reg, toload));
+         emit_insn (gen_cond_trap (LTU, stack_reg, r11_reg, const0_rtx));
+         emit_move_insn (r11_reg, tmp_reg);
        }
       else
        warning (0, "stack limit expression is not supported");