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]

Re: [PATCH] (was Re: i386 alignment tweaks...)


The patch is largely ok.

> @@ -2310,6 +2312,7 @@ layout_vtable_decl (binfo, n)
>  	 fails on Sparc unless you have 8-byte alignment.  */
>        DECL_ALIGN (vtable) = MAX (TYPE_ALIGN (double_type_node),
>  				 DECL_ALIGN (vtable));
> +      DECL_USER_ALIGN (vtable) |= TYPE_USER_ALIGN (double_type_node);

This shouldn't be.  The user cannot set double_type_node.
There are a handfull of other examples of this.

>  /* The published ABIs say that doubles should be aligned on word
>     boundaries, so lower the aligment for structure fields unless
> -   -malign-double is set.  */
> -/* BIGGEST_FIELD_ALIGNMENT is also used in libobjc, where it must be
> -   constant.  Use the smaller value in that context.  */
> -#ifndef IN_TARGET_LIBS
> -#define BIGGEST_FIELD_ALIGNMENT (TARGET_ALIGN_DOUBLE ? 64 : 32)
> -#else
> -#define BIGGEST_FIELD_ALIGNMENT 32
> -#endif
> +   -malign-double is set or unless it was overriden by attribute aligned.  */
> +#define BIGGEST_DEFAULT_FIELD_ALIGNMENT (TARGET_ALIGN_DOUBLE ? 64 : 32)

I don't think renaming the option is a good idea.  You'd need to change
all the other ports as well, for no apparent gain.  Just change the
documentation for the macro to read "except if overridden by the user".



r~

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