From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104773 invoked by alias); 4 May 2015 19:33:40 -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 104687 invoked by uid 48); 4 May 2015 19:33:33 -0000 From: "az.zaafrani at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/48052] loop not vectorized if index is "unsigned int" Date: Mon, 04 May 2015 19:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: az.zaafrani at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: cc attachments.created Message-ID: In-Reply-To: References: 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: 2015-05/txt/msg00283.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48052 zaafrani changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |az.zaafrani at gmail dot com --- Comment #10 from zaafrani --- Created attachment 35459 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35459&action=edit patch This is an old thread and we are still running into similar issues: Code is not being vectorized on 64-bit target due to scev not being able to optimally analyze overflow condition. While the original test case shown here seems to work now, it does not work if the start value is not a constant and the loop index variable is of unsigned type: Ex void loop2( double const * __restrict__ x_in, double * __restrict__ x_out, double const * __restrict__ c, unsigned int N, unsigned int start) { for(unsigned int i=start; i!=N; ++i) x_out[i] = c[i]*x_in[i]; } Here is our unit test: int foo(int* A, int* B, unsigned start, unsigned B) { int s; for (unsigned k = start; k