http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60989
Bug ID: 60989 Summary: automatic increase of global array for vectorization doesn't work due to flag_section_anchors==0 Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: andi-gcc at firstfloor dot org Target x86_64-linux Following simple test case: #define N 64 #define ALIGN // __attribute__((aligned(64))) int a[N] ALIGN; int b[N] ALIGN; main() { int i; for (i = 0; i < N; i++) a[i] = b[i] + 1; } If I leave the ALIGN commented out I get really horrible manual alignment prologue code like -O3 -mavx512f .cfi_startproc movl $a, %eax andl $63, %eax shrq $2, %rax negq %rax andl $15, %eax je .L7 movl b(%rip), %edi cmpl $1, %eax leal 1(%rdi), %edx movl %edx, a(%rip) je .L8 ... lots of repeats upto 63 With ALIGN it's a nice short perfectly vectorized loop. It seems the automatic alignment of global variables doesn't work anymore. I checked the increase_alignment/ipa_increase_alignment pass in tree-vectorize.c and both don't run because flag_section_anchors is 0 in the gate. I'm not fully sure what the flag means?