This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [mips patch rfa] avoid -Wpadded warnings for eabi.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]