[llvm-commits] [llvm-gcc-4.2] r46334 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Devang Patel
dpatel at apple.com
Fri Jan 25 09:37:46 PST 2008
Hi Duncan,
On Jan 25, 2008, at 1:01 AM, Duncan Sands wrote:
> Hi Devang,
>
>> Fix 2008-01-24-StructAlignAndBitFields.c test case.
>> Bit-field type does not influence struct alignment.
>
> I don't see the point of trying to get the LLVM type to have the same
> alignment as the gcc type.
This patch does not update llvm-gcc to generate LLVM type that matches
GCC type. GCC type alignment is 2 byte here. Before this patch LLVM
type alignment was 4 byte and now after this patch struct alignment is
1 byte.
> I think all the code that tries to obtain
> equal alignment should just be dropped. Who cares if the LLVM type
> has
> a different alignment to the gcc type? Surely all that matters is
> that
> when we allocate a variable (alloca or global), if the gcc declaration
> is more aligned than the LLVM type, then we should force the alloca/
> global
> to have the gcc alignment.
So idea is for llvm value you "fix" aligment, which can happen N
number of times for each type instead of fixing type once. However, if
you can simplify code then that is a good idea. Go for it.
-
Devang
More information about the llvm-commits
mailing list