From patchwork Mon Jul 4 11:38:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 103093 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id A2982B6F6B for ; Mon, 4 Jul 2011 21:39:24 +1000 (EST) Received: (qmail 11223 invoked by alias); 4 Jul 2011 11:39:21 -0000 Received: (qmail 11160 invoked by uid 22791); 4 Jul 2011 11:39:20 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Jul 2011 11:38:52 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id D0EBB867E2; Mon, 4 Jul 2011 13:38:50 +0200 (CEST) Date: Mon, 4 Jul 2011 13:38:50 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Cc: irar@il.ibm.com Subject: [PATCH] Fix PR49518 Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Handling of negative steps broke one of the many asserts in the vectorizer. The following patch drops one that I can't make sense of. I think all asserts need comments - especially this one would, as I can't see why using vf is correct to test against and not nelements (and why <= vf and not < vf). Well, ok? Thanks, Richard. 2011-07-04 Richard Guenther PR tree-optimization/49518 * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Drop assert. * gcc.dg/torture/pr49518.c: New testcase. Index: gcc/tree-vect-data-refs.c =================================================================== --- gcc/tree-vect-data-refs.c (revision 175800) +++ gcc/tree-vect-data-refs.c (working copy) @@ -1552,7 +1552,6 @@ vect_enhance_data_refs_alignment (loop_v for (j = 0; j < possible_npeel_number; j++) { - gcc_assert (npeel_tmp <= vf); vect_peeling_hash_insert (loop_vinfo, dr, npeel_tmp); npeel_tmp += nelements; } Index: gcc/testsuite/gcc.dg/torture/pr49518.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr49518.c (revision 0) +++ gcc/testsuite/gcc.dg/torture/pr49518.c (revision 0) @@ -0,0 +1,19 @@ +/* { dg-do compile } */ + +int a, b; +struct S { unsigned int s, t, u; } c, d = { 0, 1, 0 }; + +void +test (unsigned char z) +{ + char e[] = {0, 0, 0, 0, 1}; + for (c.s = 1; c.s; c.s++) + { + b = e[c.s]; + if (a) + break; + b = z >= c.u; + if (d.t) + break; + } +}