From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5483 invoked by alias); 11 Mar 2014 22:01: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 5424 invoked by uid 48); 11 Mar 2014 22:00:56 -0000 From: "congh at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/60505] New: Warning caused by GCC vectorizer. Date: Tue, 11 Mar 2014 22:01: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: congh at google dot com 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-03/txt/msg00932.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60505 Bug ID: 60505 Summary: Warning caused by GCC vectorizer. Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: congh at google dot com The compilation on the code below fails with options "-Wall -Werror -O2 -ftree-loop-vectorize". The reason is that the epilogue generated by the vectorizer tries to access the memory outside of ovec[16] and the the vrp pass emits the warning "array subscript is above array bounds" for the access to ovec[i]. The vectorizer should not generate the epilogue for this loop. void foo(char *in, char *out, int num) { int i; unsigned char ovec[16] = {0}; for(i=0; i < num ; ++i) out[i] = (ovec[i] = in[i]); out[num] = ovec[num/2]; }