diff options
| author | Alexey Dobriyan <adobriyan@mail.ru> | 2004-07-31 15:05:05 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:02:27 -0700 |
| commit | 05de9d16bfccffb3c760a45d93c38a8b9535df6c (patch) | |
| tree | 8592faf21cff08a28a1598fc07de820b06da65bb /compile-i386.c | |
| parent | 5d356994901aab5fa2780a2af912cdc69013beb5 (diff) | |
| download | sparse-dev-05de9d16bfccffb3c760a45d93c38a8b9535df6c.tar.gz | |
[PATCH] Generate correct push* instruction.
Pay attention to size of function arguments when pushing them to stack.
Generate "pushb" for char, "pushw" for short, ...
[ Linus' note: this is likely "wrong". In a real x86 compiler, we'd
expand the width of the argument to 32 bits regardless, but from
a demonstration standpoint this is better ]
Diffstat (limited to 'compile-i386.c')
| -rw-r--r-- | compile-i386.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compile-i386.c b/compile-i386.c index c620bf29..b92575ef 100644 --- a/compile-i386.c +++ b/compile-i386.c @@ -1824,8 +1824,7 @@ static struct storage *x86_call_expression(struct expression *expr) struct storage *new = x86_expression(arg); int size = arg->ctype->bit_size; - /* FIXME: pay attention to 'size' */ - insn("pushl", new, NULL, + insn(opbits("push", size), new, NULL, !framesize ? "begin function call" : NULL); framesize += size >> 3; |
