scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 95232a91309714fde82840811c7bae6c53dd5778
parent 44956b98edc0b97ad3319467152ad362f1632e72
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 25 Jan 2016 11:58:29 +0100

Fix definition of sizes for amd64 and i386

Diffstat:
Mcc1/arch/amd64-sysv/arch.c | 34+++++++++++++++++-----------------
Mcc1/arch/amd64-sysv/arch.h | 4++--
Mcc1/arch/i386-sysv/arch.c | 36++++++++++++++++++------------------
Mcc2/arch/amd64-sysv/types.c | 6+++---
Mcc2/arch/i386-sysv/types.c | 8++++----
5 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/cc1/arch/amd64-sysv/arch.c b/cc1/arch/amd64-sysv/arch.c @@ -80,7 +80,7 @@ static Type types[] = { .size = 2, .integer = 1, .arith = 1, - .align = 1, + .align = 2, .n.rank = RANK_USHORT, .printed = 1 }, @@ -91,7 +91,7 @@ static Type types[] = { .size = 2, .integer = 1, .arith = 1, - .align = 1, + .align = 2, .sign = 1, .n.rank = RANK_SHORT, .printed = 1 @@ -100,10 +100,10 @@ static Type types[] = { .op = INT, .letter = L_UINT, .defined = 1, - .size = 2, + .size = 4, .integer = 1, .arith = 1, - .align = 1, + .align = 4, .n.rank = RANK_UINT, .printed = 1 }, @@ -111,10 +111,10 @@ static Type types[] = { .op = INT, .letter = L_INT, .defined = 1, - .size = 2, + .size = 4, .integer = 1, .arith = 1, - .align = 1, + .align = 4, .sign = 1, .n.rank = RANK_INT, .printed = 1 @@ -123,10 +123,10 @@ static Type types[] = { .op = INT, .letter = L_LONG, .defined = 1, - .size = 4, + .size = 8, .integer = 1, .arith = 1, - .align = 1, + .align = 8, .sign = 1, .n.rank = RANK_LONG, .printed = 1 @@ -135,10 +135,10 @@ static Type types[] = { .op = INT, .letter = L_ULONG, .defined = 1, - .size = 4, + .size = 8, .integer = 1, .arith = 1, - .align = 1, + .align = 8, .n.rank = RANK_ULONG, .printed = 1 }, @@ -149,7 +149,7 @@ static Type types[] = { .size = 8, .integer = 1, .arith = 1, - .align = 1, + .align = 8, .n.rank = RANK_ULLONG, .printed = 1 }, @@ -160,7 +160,7 @@ static Type types[] = { .size = 8, .integer = 1, .arith = 1, - .align = 1, + .align = 8, .sign = 1, .n.rank = RANK_LLONG, .printed = 1 @@ -171,7 +171,7 @@ static Type types[] = { .defined = 1, .size = 4, .arith = 1, - .align = 1, + .align = 4, .n.rank = RANK_FLOAT, .printed = 1 }, @@ -181,7 +181,7 @@ static Type types[] = { .defined = 1, .size = 8, .arith = 1, - .align = 1, + .align = 8, .n.rank = RANK_DOUBLE, .printed = 1 }, @@ -191,7 +191,7 @@ static Type types[] = { .defined = 1, .size = 16, .arith = 1, - .align = 1, + .align = 16, .n.rank = RANK_LDOUBLE, .printed = 1 }, @@ -199,10 +199,10 @@ static Type types[] = { .op = INT, .letter = L_UINT, .defined = 1, - .size = 2, + .size = 8, .integer = 1, .arith = 1, - .align = 1, + .align = 8, .n.rank = RANK_UINT, .printed = 1 }, diff --git a/cc1/arch/amd64-sysv/arch.h b/cc1/arch/amd64-sysv/arch.h @@ -26,8 +26,8 @@ #define L_USHORT L_UINT16 #define L_INT L_INT32 #define L_UINT L_UINT32 -#define L_LONG L_INT32 -#define L_ULONG L_UINT32 +#define L_LONG L_INT64 +#define L_ULONG L_UINT64 #define L_LLONG L_INT64 #define L_ULLONG L_UINT64 #define L_ENUM L_INT diff --git a/cc1/arch/i386-sysv/arch.c b/cc1/arch/i386-sysv/arch.c @@ -22,8 +22,8 @@ static Type types[] = { { /* 1 = pvoidtype */ .op = PTR, .letter = L_POINTER, - .size = 2, - .align = 2, + .size = 4, + .align = 4, .printed = 1, .defined = 1, }, @@ -80,7 +80,7 @@ static Type types[] = { .size = 2, .integer = 1, .arith = 1, - .align = 1, + .align = 2, .n.rank = RANK_USHORT, .printed = 1 }, @@ -91,7 +91,7 @@ static Type types[] = { .size = 2, .integer = 1, .arith = 1, - .align = 1, + .align = 2, .sign = 1, .n.rank = RANK_SHORT, .printed = 1 @@ -100,10 +100,10 @@ static Type types[] = { .op = INT, .letter = L_UINT, .defined = 1, - .size = 2, + .size = 4, .integer = 1, .arith = 1, - .align = 1, + .align = 4, .n.rank = RANK_UINT, .printed = 1 }, @@ -111,10 +111,10 @@ static Type types[] = { .op = INT, .letter = L_INT, .defined = 1, - .size = 2, + .size = 4, .integer = 1, .arith = 1, - .align = 1, + .align = 4, .sign = 1, .n.rank = RANK_INT, .printed = 1 @@ -126,7 +126,7 @@ static Type types[] = { .size = 4, .integer = 1, .arith = 1, - .align = 1, + .align = 4, .sign = 1, .n.rank = RANK_LONG, .printed = 1 @@ -138,7 +138,7 @@ static Type types[] = { .size = 4, .integer = 1, .arith = 1, - .align = 1, + .align = 4, .n.rank = RANK_ULONG, .printed = 1 }, @@ -149,7 +149,7 @@ static Type types[] = { .size = 8, .integer = 1, .arith = 1, - .align = 1, + .align = 4, .n.rank = RANK_ULLONG, .printed = 1 }, @@ -160,7 +160,7 @@ static Type types[] = { .size = 8, .integer = 1, .arith = 1, - .align = 1, + .align = 4, .sign = 1, .n.rank = RANK_LLONG, .printed = 1 @@ -171,7 +171,7 @@ static Type types[] = { .defined = 1, .size = 4, .arith = 1, - .align = 1, + .align = 4, .n.rank = RANK_FLOAT, .printed = 1 }, @@ -181,7 +181,7 @@ static Type types[] = { .defined = 1, .size = 8, .arith = 1, - .align = 1, + .align = 4, .n.rank = RANK_DOUBLE, .printed = 1 }, @@ -189,9 +189,9 @@ static Type types[] = { .op = FLOAT, .letter = L_LDOUBLE, .defined = 1, - .size = 16, + .size = 12, .arith = 1, - .align = 1, + .align = 4, .n.rank = RANK_LDOUBLE, .printed = 1 }, @@ -199,10 +199,10 @@ static Type types[] = { .op = INT, .letter = L_UINT, .defined = 1, - .size = 2, + .size = 4, .integer = 1, .arith = 1, - .align = 1, + .align = 4, .n.rank = RANK_UINT, .printed = 1 }, diff --git a/cc2/arch/amd64-sysv/types.c b/cc2/arch/amd64-sysv/types.c @@ -42,7 +42,7 @@ Type uint16type = { Type uint32type = { .flags = INTF, .size = 4, - .align = 2 + .align = 4 }; Type uint64type = { @@ -74,8 +74,8 @@ Type float64type = { }; Type float80type = { - .size = 10, - .align = 12 + .size = 16, + .align = 16 }; Type voidtype = { diff --git a/cc2/arch/i386-sysv/types.c b/cc2/arch/i386-sysv/types.c @@ -24,7 +24,7 @@ Type int32type = { Type int64type = { .flags = SIGNF | INTF, .size = 8, - .align = 8 + .align = 4 }; Type uint8type = { @@ -48,7 +48,7 @@ Type uint32type = { Type uint64type = { .flags = INTF, .size = 8, - .align = 2 + .align = 4 }; Type ptrtype = { @@ -70,11 +70,11 @@ Type float32type = { Type float64type = { .size = 8, - .align = 8 + .align = 4 }; Type float80type = { - .size = 10, + .size = 12, .align = 4 };