This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [mips patch rfa] avoid -Wpadded warnings for eabi.
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: cgd at broadcom dot com
- Cc: gcc-patches at gcc dot gnu dot org, echristo at redhat dot com
- Date: 27 Jun 2003 09:10:55 +0100
- Subject: Re: [mips patch rfa] avoid -Wpadded warnings for eabi.
- References: <yov58yroqfct.fsf@ldt-sj3-010.sj.broadcom.com>
cgd@broadcom.com writes:
> @@ -4287,19 +4288,26 @@ mips_build_va_list ()
> unsigned_char_type_node);
> f_foff = build_decl (FIELD_DECL, get_identifier ("__fpr_offset"),
> unsigned_char_type_node);
> -
> + /* Explicitly pad with 2 bytes (or 6, if TARGET_LONG64), so that
> + -Wpadded won't warn on every user file. */
> + index = build_int_2 (TARGET_LONG64 ? 5 : 1, 0);
> + array = build_array_type (unsigned_char_type_node,
> + build_index_type (index));
> + f_res = build_decl (FIELD_DECL, get_identifier ("__reserved"), array);
>
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 ;)
How about having something like:
index = build_int_2 (GET_MODE_SIZE (ptr_mode) - 2 - 1, 0);
Richard