From 5a6d0ede91bddf21b494382d6d975d6fb2db80a9 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 29 May 2008 10:58:49 +0000 Subject: Always use packed structs. This isn't really very nice, but there's nothing fundamentally wrong with it. Emitting unpacked structs where possible is more work for almost no practical benefit. We'll probably want to fix it at some point anyway, but it's low priority. The issue with long double in particular is that LLVM thinks an X86 long double is 10 bytes, while clang considers it for all purposes to be either 12 or 16 bytes, depending on the platform, even in a packed struct. llvm-svn: 51673 --- clang/test/CodeGen/struct.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/test/CodeGen/struct.c') diff --git a/clang/test/CodeGen/struct.c b/clang/test/CodeGen/struct.c index f17a7af76c8..f567a0b2ff1 100644 --- a/clang/test/CodeGen/struct.c +++ b/clang/test/CodeGen/struct.c @@ -163,3 +163,6 @@ int f14(int i, ...) { /* Attribute packed */ struct __attribute__((packed)) S2839 { double a[19]; signed char b; } s2839[5]; + +struct __attribute__((packed)) SS { long double a; char b; } SS; + -- cgit v1.2.3