From a71eee391420c2e7c284e217190290520d3e1ec3 Mon Sep 17 00:00:00 2001 From: George Koehler Date: Wed, 28 Sep 2016 00:13:35 -0400 Subject: [PATCH] For "pat ass", move fake stack to real stack before adjusting SP. This fixes code that tried to "addi SP, SP, 4" to drop a value that was in a register, not on the real stack. Add a rule to optimize "asp 4" (which becomes "loc 4" "ass") when the value being dropped is already in a GPR. --- mach/powerpc/ncg/table | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mach/powerpc/ncg/table b/mach/powerpc/ncg/table index 547fe070b..a5585bed7 100644 --- a/mach/powerpc/ncg/table +++ b/mach/powerpc/ncg/table @@ -2004,12 +2004,19 @@ PATTERNS pat str $1==2 /* Store HP */ leaving ste ".reghp" - + + pat loc ass $1==4 /* Drop 4 bytes from stack */ + with exact GPR + /* nop */ + with STACK + gen + addi SP, SP, {CONST, 4} + pat ass /* Adjust stack by variable amount */ - with CONST + with CONST STACK gen move {SUM_RC, SP, %1.val}, {GPRE, SP} - with GPR + with GPR STACK gen move {SUM_RR, SP, %1}, {GPRE, SP} -- 2.34.1