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.
This commit is contained in:
parent
1e3dde915a
commit
a71eee3914
|
@ -2005,11 +2005,18 @@ PATTERNS
|
|||
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}
|
||||
|
||||
|
|
Loading…
Reference in a new issue