This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: BIGGEST_ALIGNMENT vs g++ compat test expectation on aix ?
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: Olivier Hainque <hainque at adacore dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 30 Jun 2009 10:22:01 -0400
- Subject: Re: BIGGEST_ALIGNMENT vs g++ compat test expectation on aix ?
- References: <20090629135915.GA1654@cardhu.act-europe.fr>
On Mon, Jun 29, 2009 at 9:59 AM, Olivier Hainque<hainque@adacore.com> wrote:
> Working on a collect2 related patch resubmission for ppc-aix, I
> stumbled on regressions in the c++ series for a problem unrelated to
> my change. Not sure how you'd typically deal with these, so providing
> the datapoints here.
>
> tmpdir-g++.dg-struct-layout-1/t027 and a couple of other tests failed
> from constructs like
>
> ? ?struct S2661 {
> ? ? ? ?union{v16sf b[31];Tal2short c __attribute__((aligned (4)));}a;
> ? ? ? ?float d;
> ? ?};
>
> ? ?struct S2661 s2661;
> ? ?struct S2661 a2661[5];
>
> ? ?info.als = __alignof__ (s2661);
> ? ?if (&a2661[3] & (info.als - 1)) FAIL ...
>
> the alignment check is up to that of v16sf (64bytes), and this
> occasionaly fails because csects are "only" aligned in accordance with
>
> ? rs6000.h:#define BIGGEST_ALIGNMENT 128
>
> The discrepancy is visible straight from the assembly output
> for e.g. t027_y (out of the unchanged compiler as well):
>
> ? ? ? ?.csect .data[RW],4
> ? ? ? ? ? ? ? ? ? ? ? ?^^^
> ? ? ? ?.align 6
> ? ? ? ? ? ? ?^^^
> a2661:
> ? ? ? ?.space 10240
The default alignment of CSECTs is 4, but using -fdata-sections should
place the object in its own CSECT with stricter alignment.
David