Align on 4n bytes when copying fct args on stack
authorThomas Preud'homme <robotux@celest.fr>
Tue, 5 Feb 2013 09:35:12 +0000 (5 10:35 +0100)
committerThomas Preud'homme <robotux@celest.fr>
Tue, 5 Feb 2013 09:48:42 +0000 (5 10:48 +0100)
When copying function arguments on stack in prolog, use multiple of 4
bytes for alignment.

arm-gen.c

index 03b5fd7..8dc6691 100644 (file)
--- a/arm-gen.c
+++ b/arm-gen.c
@@ -1202,6 +1202,7 @@ void gfunc_prolog(CType *func_type)
       type = &sym->type;
       size = type_size(type, &align);
       size = (size + 3) >> 2;
+      align = (align + 3) & ~3;
 #ifdef TCC_ARM_HARDFLOAT
       if (!variadic && (is_float(sym->type.t)
           || is_float_hgen_aggr(&sym->type))) {