On Mon, Jun 29, 2009 at 9:59 AM, Olivier Hainque<hain...@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

Reply via email to