+2017-09-20 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/77687
+ * config/rs6000/rs6000.md (stack_restore_tie): Store to a scratch
+ address instead of to r1 and r11.
+
2017-09-20 Sebastian Peryt <sebastian.peryt@intel.com>
* config.gcc: Support "knm".
; Some 32-bit ABIs do not have a red zone, so the stack deallocation has to
; stay behind all restores from the stack, it cannot be reordered to before
-; one. See PR77687. This insn is an add or mr, and a stack_tie on the
-; operands of that.
+; one. See PR77687. This insn is an add or mr, and a memory clobber.
(define_insn "stack_restore_tie"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
(plus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
(match_operand:SI 2 "reg_or_cint_operand" "O,rI")))
- (set (mem:BLK (match_dup 0)) (const_int 0))
- (set (mem:BLK (match_dup 1)) (const_int 0))]
+ (set (mem:BLK (scratch)) (const_int 0))]
"TARGET_32BIT"
"@
mr %0,%1
+2017-09-19 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/77687
+ * gcc.target/powerpc/pr77687.c: New testcase.
+
2017-09-20 Jakub Jelinek <jakub@redhat.com>
P0409R2 - allow lambda capture [=, this]
--- /dev/null
+/* { dg-options "-std=gnu99 -O2" } */
+/* { dg-final { scan-assembler-not {\mmr r?1,r?11\M.*11.*\mblr\M} } } */
+
+/* PR77687: We used to do stack accesses (via r11) after restoring r1. */
+
+void g(int, char *);
+const char * dum = "hello";
+
+void f(int x)
+{
+ char big[200000];
+ start:
+ g(x, big);
+ g(x, big);
+ register void *p asm("r11") = &&start;
+ asm("" : : "r"(p));
+ asm("" : : :"r28");
+ asm("" : : :"r29");
+ asm("" : : :"r30");
+}