From 17211eef475fcf91cda493c968c0565798f413a4 Mon Sep 17 00:00:00 2001 From: George Koehler Date: Fri, 9 Dec 2016 17:32:42 -0500 Subject: [PATCH] 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'. --- mach/powerpc/ncg/table | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mach/powerpc/ncg/table b/mach/powerpc/ncg/table index 9d12698e5..cf3de92fd 100644 --- a/mach/powerpc/ncg/table +++ b/mach/powerpc/ncg/table @@ -2003,14 +2003,14 @@ PATTERNS gen 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 /* nop */ with STACK gen addi SP, SP, {CONST, 4} - pat ass /* Adjust stack by variable amount */ + pat ass $1==4 /* Adjust stack by variable amount */ with CONST2 STACK gen move {SUM_RC, SP, %1.val}, SP @@ -2028,7 +2028,7 @@ PATTERNS pat asp /* Adjust stack by constant amount */ leaving loc $1 - ass + ass 4 -- 2.34.1