aboutsummaryrefslogtreecommitdiff
path: root/x86_64-gen.c
diff options
context:
space:
mode:
authorPavlas, Zdenek <zden3k@gmail.com>2016-08-17 06:12:11 -0700
committerPavlas, Zdenek <zden3k@gmail.com>2016-08-17 06:23:15 -0700
commitc948732efaf823f36d05608fe716bfcc4a98b70c (patch)
treef765e9c4a4024991a83aa82d5a18650d2737b445 /x86_64-gen.c
parent0373fe0e2a50e8e25700bd448bb7edf47c99b443 (diff)
downloadtinycc-c948732efaf823f36d05608fe716bfcc4a98b70c.tar.gz
tinycc-c948732efaf823f36d05608fe716bfcc4a98b70c.tar.bz2
x86_64/elf: only variadic calls need rax
Diffstat (limited to 'x86_64-gen.c')
-rw-r--r--x86_64-gen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/x86_64-gen.c b/x86_64-gen.c
index 5a122d0..ec613eb 100644
--- a/x86_64-gen.c
+++ b/x86_64-gen.c
@@ -1441,7 +1441,8 @@ void gfunc_call(int nb_args)
}
}
- oad(0xb8, nb_sse_args < 8 ? nb_sse_args : 8); /* mov nb_sse_args, %eax */
+ if (vtop->type.ref->c != FUNC_NEW) /* implies FUNC_OLD or FUNC_ELLIPSIS */
+ oad(0xb8, nb_sse_args < 8 ? nb_sse_args : 8); /* mov nb_sse_args, %eax */
gcall_or_jmp(0);
if (args_size)
gadd_sp(args_size);