This is the mail archive of the gcc@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: PR 19893 & array_ref bug


> > The gcc.dg/compat/struct-layout problems seem to stem from
> > struct-layout-1_generate.c.  In generate_fields() it generates random
> > types, some of these are arrays of some base type.  Then based on
> > another random number we might add an attribute like alignment.  There
> > is no check to ensure that the alignment of the base type is less than or
> > equal to the size of the base type in those instances where we are
> > creating an array.
> 
> That could be fixed by adding the check you suggest, and then just 
> discarding the attribute.

I don't know if I have enough information to implement a test that
ignores the attribute only when the alignment is greater than the size.
Some of the attributes use __aligned__ with no value and that defaults
to whatever the maximum alignment is for the platform you are running on
and I don't know if I can determine that while running
struct-layout-1_generate.

The simplest solution would probably be to ignore __aligned__ attributes
completely when we have an array.  Or to do the change you suggested for
the vector tests and have the attribute attached to the array and not
the element type.

Steve Ellcey
sje@cup.hp.com


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