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: RFA: fix for 17961 (ppc vectors)


On Thu, Jun 09, 2005 at 04:40:33PM -0700, Richard Henderson wrote:
> On Thu, Jun 09, 2005 at 07:37:31PM -0400, Aldy Hernandez wrote:
> > p.s. You do mean, taking all of this out, right?:
> > 
> > > > !   ((TARGET_ALTIVEC  && TREE_CODE (TYPE) == VECTOR_TYPE            \
> > > > !     && ALTIVEC_VECTOR_MODE (TYPE_MODE (TYPE)))                    \
> 
> Yes.

This would mean that for sysv4.h and linux64.h, ROUND_TYPE_ALIGN would be 
defined as:

#define ROUND_TYPE_ALIGN(TYPE, COMPUTED, SPECIFIED) MAX (COMPUTED, SPECIFIED)

According to the documentation, this is the default behavior if
you don't define ROUND_TYPE_ALIGN.  But in checking its uses (all
in stor-layout.c), I see one use in finalize_type_size() which does
not default to the max of COMPUTED and SPECIFIED:

	  /* Do machine-dependent extra alignment.  */
	#ifdef ROUND_TYPE_ALIGN
	  TYPE_ALIGN (type)
	    = ROUND_TYPE_ALIGN (type, TYPE_ALIGN (type), BITS_PER_UNIT);
	#endif

Should there be an #else case for the default behavior?

If so, can we get rid of all this #if-else business in favor of a default
implementation in, say rtl.h (?):

#ifndef ROUND_TYPE_ALIGN
#define ROUND_TYPE_ALIGN(TYPE, COMPUTED, SPECIFIED) MAX (COMPUTED, SPECIFIED)
#endif

Also, is there a reason why rs6000/linux64.h has its own definition of
ROUND_TYPE_ALIGN that's exactly the same as sysv4.h's?  From what I can
see, powerpc64-*-linux* includes sysv4.h, so the linux64.h version is
redundant.

Aldy


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