[llvm-commits] [llvm-gcc-4.2] r46966 - in /llvm-gcc-4.2/trunk/gcc: config/i386/i386.h config/rs6000/rs6000.h llvm-abi.h

Dale Johannesen dalej at apple.com
Tue Feb 12 08:19:28 PST 2008


On Feb 12, 2008, at 5:17 AM, Duncan Sands wrote:

> Hi Dale,
>
>>>> Treat struct { long long: 29; }; as int sized and
>>>> aligned, rather than long long.  ABI issue.
>>>
>>> if you look at the DECL_SIZE of the bitfield, rather than
>>> the type size, I think it gives you 29.  If so, DECL_SIZE
>>> should simplify things for you.  In fact as far as I can
>>> see you should never use the type size for a record field.
>>> For example the struct conversion stuff uses DECL_SIZE everywhere
>>> (except at one point in the field indexing - I have a patch to fix
>>> that which I'll apply at some point).  Not using the type size
>>> makes all these "it's a big type shoved in a small place" problems
>>> magically go away.
>>
>> I'm not sure what your suggestion is exactly; the issue isn't the
>> size, it is
>> that the code in HandleArgument for general RECORD_TYPEs is looking
>> at getDeclaredType, not the type in the field.  (So what this patch
>> does is
>> use the INTEGER_REGS case instead.)  The wide use of getDeclaredType
>> and the comments describing it make me think it would be unsafe in
>> general
>> to change that.  It would certainly be more elegant if it works,  
>> though.
>
> I guess I'm confused, but in the example are you saying that you want
> to pass this in registers as a long long?  Or the opposite: you want
> to pass it as an i32 because it fits in 32 bits?  Or something else?

The latter.  Before this patch the parameter passing code was  
producing i64 for it, which is wrong.




More information about the llvm-commits mailing list