This is the mail archive of the
mailing list for the GCC project.
Re: [mips patch rfa] avoid -Wpadded warnings for eabi.
I see Eric's already approved the patch, but I thought I'd better
respond to this bit:
> At Fri, 27 Jun 2003 08:14:10 +0000 (UTC), "Richard Sandiford" wrote:
> > I'm not sure TARGET_LONG64 is really the right thing to use here.
> > The structure contains pointers, not longs, so I think you'd end
> > up overpadding the structure for -mabi=eabi -mgp32 -mlong64.
> > (yes, it is a supported combination ;)
> OK, and based on your suggestion i'm assuming that in that mode, the
> required pointer/long alignment is still 64-bits. 8-)
No, the structure should be 32-bit aligned in that case.
-mgp32 selects 32-bit code, so pointers are 32 bits wide and have 32-bit
alignment. And since the structure contains pointers and chars, it's the
pointer alignment that matters.
In other words -mlong64 doesn't affect the padding needed for EABI32.
The idea was that:
GET_MODE_SIZE (ptr_mode) - 2 - 1
will be 1 in this case, giving 2 bytes of padding, not 6 as in
the original patch.
Your second (approved) patch looks good to me though.;)