Fix ass to match the EM spec.

The spec says, "ASS w: Adjust the stack pointer by w-byte integer".
The w argument "can either be given as argument or on top of the
stack."  Therefore, 'ass 4' would pop the 4-byte integer from the
stack, but 'ass' would pop the size w from the stack, then pop the
w-byte integer.

PowerPC ncg wrongly implemented 'ass' as if it was 'ass 4'.  Fix it to
accept only 'ass 4'.
This commit is contained in:
George Koehler 2016-12-09 17:32:42 -05:00
parent 5bd0ad4269
commit 17211eef47

View file

@ -2003,14 +2003,14 @@ PATTERNS
gen gen
move %1, SP move %1, SP
pat loc ass $1==4 /* Drop 4 bytes from stack */ pat loc ass $1==4 && $2==4 /* Drop 4 bytes from stack */
with exact GPR with exact GPR
/* nop */ /* nop */
with STACK with STACK
gen gen
addi SP, SP, {CONST, 4} addi SP, SP, {CONST, 4}
pat ass /* Adjust stack by variable amount */ pat ass $1==4 /* Adjust stack by variable amount */
with CONST2 STACK with CONST2 STACK
gen gen
move {SUM_RC, SP, %1.val}, SP move {SUM_RC, SP, %1.val}, SP
@ -2028,7 +2028,7 @@ PATTERNS
pat asp /* Adjust stack by constant amount */ pat asp /* Adjust stack by constant amount */
leaving leaving
loc $1 loc $1
ass ass 4