From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24300 invoked by alias); 15 Oct 2010 14:59:18 -0000 Received: (qmail 24290 invoked by uid 22791); 15 Oct 2010 14:59:18 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Oct 2010 14:59:11 +0000 From: "belagod at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/46038] New: Vectorizer generates misaligned address for vld1 qn, [rn:alignment] X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: belagod at gcc dot gnu.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-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Fri, 15 Oct 2010 14:59:00 -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 X-SW-Source: 2010-10/txt/msg01291.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46038 Summary: Vectorizer generates misaligned address for vld1 qn, [rn:alignment] Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned@gcc.gnu.org ReportedBy: belagod@gcc.gnu.org CC: jules@gcc.gnu.org This test case: extern void abort (void); void foo (short *__restrict in, int n, int l, short *__restrict o) __attribute__((noinline)); void foo (short *__restrict in, int n, int l , short *__restrict o) { int A=0, lg, i; for (lg = 0; lg < n; lg++) { A = 0; for (i = 0; i < l; i++) A += (int)in[i] + (int)in[i+lg]; } if (A != 256) abort (); } int main() { short in[32]; short o[4]; int i; for (i=0;i<32;i++) in[i] = i; foo (in, 2, 16, o); return 0; } aborts. It's compiled with -c -static -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp foo.c -marm -O3. The first iteration's result 'A' is correct. The second iteration's result is broken. The bug seems to be during the second iteration of the outer loop in foo(), the vld1.16 at 0x8514 seems to be getting a bogus base address that isn't 8-byte aligned inspite of the assertion [rn:64]. This might be a potential source of the bug. The output of dmesg on a cortex-a8 is: Alignment trap: not handling instruction edc30b00 at [<0000c64c>] Unhandled fault: alignment exception (0x801) at 0xbe8818c9