diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2016-10-04 16:47:29 +0200 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2016-10-04 16:47:29 +0200 |
commit | 67c58f9ee025fb2fc0de6d932366b7e5db7a6678 (patch) | |
tree | 004fd3c3a10d69c06ab6ff7082e947fc1af8f85f /ia32/CBuiltins.ml | |
parent | d2af79a77ed2936ff0ed90cadf8e48637d774d4c (diff) | |
download | compcert-67c58f9ee025fb2fc0de6d932366b7e5db7a6678.tar.gz compcert-67c58f9ee025fb2fc0de6d932366b7e5db7a6678.zip |
Fix some 32-bit regressions
While merging the 32- and 64-bit code generators, some regressions were introduced in the 32 bit case.
Diffstat (limited to 'ia32/CBuiltins.ml')
-rw-r--r-- | ia32/CBuiltins.ml | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ia32/CBuiltins.ml b/ia32/CBuiltins.ml index 1fe3b200..09303223 100644 --- a/ia32/CBuiltins.ml +++ b/ia32/CBuiltins.ml @@ -17,10 +17,17 @@ open C +let (va_list_type, va_list_scalar, size_va_list) = + if Archi.ptr64 then + (* Actually a struct passed by reference; equivalent to 3 64-bit words *) + (TArray(TInt(IULong, []), Some 3L, []), false, 3*8) + else + (* Just a pointer *) + (TPtr(TVoid [], []), true, 4) + let builtins = { Builtins.typedefs = [ - (* Actually a struct passed by reference; equivalent to 3 64-bit words *) - "__builtin_va_list", TArray(TInt(IULong, []), Some 3L, []) + "__builtin_va_list", va_list_type; ]; Builtins.functions = [ (* Integer arithmetic *) @@ -82,9 +89,6 @@ let builtins = { ] } -let size_va_list = 3*8 -let va_list_scalar = false - (* Expand memory references inside extended asm statements. Used in C2C. *) let asm_mem_argument arg = Printf.sprintf "0(%s)" arg |