https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82210

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldyh at gcc dot gnu.org

--- Comment #3 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Even with aligned, as Richard points out:

    struct {
        __attribute__((aligned(16)))
        struct {
            short aa;
        } a[size];
        int b[size];
    } s;

the .original dump setting s.b[i]=0 is:

  s.b{off: (sizetype) SAVE_EXPR <size> * 2}[i] = 0;

I would have expected size * 2 plus magic to round up to 16 bytes.  It looks
like we're throwing away the alignment.

As a reference, without the aligned attribute we get:

  s.b{off: (sizetype) SAVE_EXPR <size> * 2 + 3 & 18446744073709551612}[i] = 0;

  Note: C operator precedence actually yields (size * 2 + 3) & blah

Which is rounding up to 4 byte alignment.

I'll investigate.

Reply via email to