This is the mail archive of the gcc-bugs@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]

[Bug target/37216] [cygming] Invalid alignment for SSE store to .comm data generated with -O3



------- Comment #20 from sherpya at netfarm dot it  2008-09-29 19:33 -------
align testcase looks ok, but anyway I'm mainly interested to have code aligned
to 16. volatile around variables is not enough in my test program.

Nick's testcase is ok even on (local-only align) patched gcc 4.2

I've solved to_xstring problem by using vsnwprintf instead, but current trunk
produces buggy ffmpeg executable so many tests are crashing

aligned data looks ok, at least the variables that were unaligned when it was
crashing

I'm still not so sure about the optimization and the alignment, this code:
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>

static volatile int local_16[8] __attribute__ ((aligned (16)));
static volatile int local_32[8] __attribute__ ((aligned (32)));

int volatile global_16[8] __attribute__ ((aligned (16)));
int volatile global_32[8] __attribute__ ((aligned (32)));

int main(void)
{
    volatile double diff16, diff32;
    printf("Local Aligned 16: %d\n", (intptr_t) local_16 % 16);
    printf("Local Aligned 32: %d\n", (intptr_t) local_32 % 32);
    printf("Global Aligned 16: %d\n", (intptr_t) global_16 % 16);
    printf("Global Aligned 32: %d\n", (intptr_t) global_32 % 32);
    diff16 = (intptr_t) global_16 / 16.0f;
    diff32 = (intptr_t) global_32 / 32.0f;
    printf("16 -> %f - 32 -> %f\n", diff16, diff32);
    return 0;
}

still outputs:
Local Aligned 16: 0
Local Aligned 32: 0
Global Aligned 16: 0
Global Aligned 32: 16
16 -> 263177.000000 - 32 -> 131587.500000

regardless of the optimizations options


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216


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