From patchwork Wed Nov 9 06:42:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Rosen X-Patchwork-Id: 4966 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D2EA523E0C for ; Wed, 9 Nov 2011 06:42:43 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 993C2A18860 for ; Wed, 9 Nov 2011 06:42:43 +0000 (UTC) Received: by faan26 with SMTP id n26so1931320faa.11 for ; Tue, 08 Nov 2011 22:42:43 -0800 (PST) Received: by 10.152.112.10 with SMTP id im10mr658299lab.2.1320820963239; Tue, 08 Nov 2011 22:42:43 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.10.72 with SMTP id g8cs157437lab; Tue, 8 Nov 2011 22:42:42 -0800 (PST) Received: by 10.68.73.98 with SMTP id k2mr3089473pbv.2.1320820954974; Tue, 08 Nov 2011 22:42:34 -0800 (PST) Received: from mail-pz0-f42.google.com (mail-pz0-f42.google.com [209.85.210.42]) by mx.google.com with ESMTPS id jk8si5179946pbc.246.2011.11.08.22.42.33 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Nov 2011 22:42:34 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.42 is neither permitted nor denied by best guess record for domain of ira.rosen@linaro.org) client-ip=209.85.210.42; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.42 is neither permitted nor denied by best guess record for domain of ira.rosen@linaro.org) smtp.mail=ira.rosen@linaro.org Received: by pzk2 with SMTP id 2so884366pzk.1 for ; Tue, 08 Nov 2011 22:42:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.6.234 with SMTP id e10mr2926224pba.90.1320820952915; Tue, 08 Nov 2011 22:42:32 -0800 (PST) Received: by 10.142.187.15 with HTTP; Tue, 8 Nov 2011 22:42:32 -0800 (PST) Date: Wed, 9 Nov 2011 08:42:32 +0200 Message-ID: Subject: [patch] Fix PR tree-optimization/51015 From: Ira Rosen To: gcc-patches@gcc.gnu.org Cc: Patch Tracking Hi, Some of the recently added vectorizer pattern detection functions create pattern def stmts, and set vectype for these statements. This causes an assert failure in vect_determine_vectorization_factor, since we only expect data-refs and pattern statements themselves to have the vectype set. This patch updates the assert. Bootstrapped on powerpc64-suse-linux and tested on powerpc64-suse-linux and x86_64-suse-linux. Committed. Ira ChangeLog: PR tree-optimization/51015 * tree-vect-loop.c (vect_determine_vectorization_factor): Expect vectype to be set for pattern def stmts. testsuite/ChangeLog: PR tree-optimization/51015 * gcc.dg/vect/pr51015.c: New test. +/* { dg-final { cleanup-tree-dump "vect" } } */ Index: tree-vect-loop.c =================================================================== --- tree-vect-loop.c (revision 181159) +++ tree-vect-loop.c (working copy) @@ -342,10 +342,12 @@ vect_determine_vectorization_factor (loop_vec_info if (STMT_VINFO_VECTYPE (stmt_info)) { /* The only case when a vectype had been already set is for stmts - that contain a dataref, or for "pattern-stmts" (stmts generated - by the vectorizer to represent/replace a certain idiom). */ + that contain a dataref, or for "pattern-stmts" (stmts + generated by the vectorizer to represent/replace a certain + idiom). */ gcc_assert (STMT_VINFO_DATA_REF (stmt_info) - || is_pattern_stmt_p (stmt_info)); + || is_pattern_stmt_p (stmt_info) + || pattern_def); vectype = STMT_VINFO_VECTYPE (stmt_info); } else Index: testsuite/gcc.dg/vect/pr51015.c =================================================================== --- testsuite/gcc.dg/vect/pr51015.c (revision 0) +++ testsuite/gcc.dg/vect/pr51015.c (revision 0) @@ -0,0 +1,19 @@ +/* { dg-do compile } */ + +typedef unsigned long long __u64; +static __u64 ext2_max_sizes[16 - 10 + 1]; + +void e2fsck_pass1() +{ + int i; + __u64 max_sizes; + + for (i = 10; i <= 16; i++) { + max_sizes = 12 + (1ULL << ((i) - 2)); + max_sizes = max_sizes + (1ULL << ((i) - 2)) * (1ULL << ((i) - 2)); + max_sizes = max_sizes + (1ULL << ((i) - 2)) * (1ULL << ((i) - 2)) * (1ULL <<((i) - 2)); + ext2_max_sizes[i - 10] = max_sizes; + } +} +