summaryrefslogtreecommitdiff
path: root/gcc48-rh1469697-19.patch
blob: 655097eb106cf4e318b56dc1c2c099b167d8143f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
2017-10-31  Segher Boessenkool  <segher@kernel.crsahing.org>

       PR target/82674
       * config/rs6000/rs6000.md (allocate_stack): Force update interval
       into a register if it does not fit into an immediate offset field.


diff -Nrup a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
--- a/gcc/config/rs6000/rs6000.md	2017-11-06 09:12:21.128237467 -0700
+++ b/gcc/config/rs6000/rs6000.md	2017-11-06 09:13:40.521601373 -0700
@@ -11886,6 +11886,9 @@
 	{
 	  rtx loop_lab, end_loop;
 	  bool rotated = CONST_INT_P (rounded_size);
+	  rtx update = GEN_INT (-probe_interval);
+	  if (probe_interval > 32768)
+	    update = force_reg (Pmode, update);
 
 	  emit_stack_clash_protection_probe_loop_start (&loop_lab, &end_loop,
 							last_addr, rotated);
@@ -11893,13 +11896,11 @@
 	  if (Pmode == SImode)
 	    emit_insn (gen_movsi_update_stack (stack_pointer_rtx,
 					       stack_pointer_rtx,
-					       GEN_INT (-probe_interval),
-					       chain));
+					       update, chain));
 	  else
 	    emit_insn (gen_movdi_di_update_stack (stack_pointer_rtx,
 					          stack_pointer_rtx,
-					          GEN_INT (-probe_interval),
-					          chain));
+					          update, chain));
 	  emit_stack_clash_protection_probe_loop_end (loop_lab, end_loop,
 						      last_addr, rotated);
 	}