From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20418 invoked by alias); 28 Apr 2014 15:21:01 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 20388 invoked by uid 48); 28 Apr 2014 15:20:57 -0000 From: "andi-gcc at firstfloor dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/60989] New: automatic increase of global array for vectorization doesn't work due to flag_section_anchors==0 Date: Mon, 28 Apr 2014 15:21:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: andi-gcc at firstfloor dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-04/txt/msg02088.txt.bz2 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?