From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7247 invoked by alias); 14 Mar 2011 10:08:58 -0000 Received: (qmail 7236 invoked by uid 22791); 14 Mar 2011 10:08:57 -0000 X-SWARE-Spam-Status: No, hits=-2.8 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; Mon, 14 Mar 2011 10:08:53 +0000 From: "vincenzo.innocente at cern dot ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/48052] loop not vectorized if index is "unsigned int" X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vincenzo.innocente at cern dot ch X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 14 Mar 2011 10:08: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: 2011-03/txt/msg01374.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48052 --- Comment #9 from vincenzo Innocente 2011-03-14 10:08:29 UTC --- It is interesting to note that in case of fixed size (such as in these trivial or template examples) vectorization works also for unsigned int void loop10( double const * __restrict__ x_in, double * __restrict__ x_out, double const * __restrict__ c) { for(unsigned int i=0; i!=10; ++i) x_out[i] = c[i]*x_in[i]; } template void loopTu( T const * __restrict__ x_in, T * __restrict__ x_out, T const * __restrict__ c) { for(unsigned int i=0; i!=N; ++i) x_out[i] = c[i]*x_in[i]; } template void loopTull( T const * __restrict__ x_in, T * __restrict__ x_out, T const * __restrict__ c) { for(unsigned long long i=0; i!=N; ++i) x_out[i] = c[i]*x_in[i]; } void go(double const * __restrict__ x_in, double * __restrict__ x_out, double const * __restrict__ c) { loopTu(x_in, x_out, c); loopTull(x_in, x_out, c); }