From patchwork Wed Feb 25 18:13:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 443581 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 58CC814010F for ; Thu, 26 Feb 2015 05:14:11 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=NSleAmXI; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=tnAdQiIkiVnkEqaQGQ82S0qNWDt9N7uSyDGT90gCU2P t/C5exrPWJjGf5ZBnn/szcU9k9o5wbNcOP1hPmqE5Nlf0HCRNBRZmSQk+o2BSjdQ mKuQPaw+QZ67G0REoEQtir1S2rb6YJ2PlzC3IiquGxtVkaz5Bgvdd4qwsro04Qm0 = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; s=default; bh=iv5l17Ek9cmGDzICCeJ2Rc9AnVQ=; b=NSleAmXI4tJBXFXOz mKvTnjf2JWpn6W5EL/E1NKYpwopD1g4A1XUYr5OJMG2SUZo7ixoSOEEw2Gg9vMGH kxMwYqpbM4o27NHvKkq1u1Za4IM69epNKw4y2K6ZLrVDdbsX8dSIzini7rRBzTMj Q/eQL3ECc3KUYhgE1EKbk/o9Eo= Received: (qmail 65532 invoked by alias); 25 Feb 2015 18:14:00 -0000 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 Received: (qmail 65516 invoked by uid 89); 25 Feb 2015 18:13:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f49.google.com Received: from mail-wg0-f49.google.com (HELO mail-wg0-f49.google.com) (74.125.82.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 25 Feb 2015 18:13:58 +0000 Received: by wggz12 with SMTP id z12so5407156wgg.2 for ; Wed, 25 Feb 2015 10:13:55 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.184.83 with SMTP id es19mr8430635wjc.93.1424888035396; Wed, 25 Feb 2015 10:13:55 -0800 (PST) Received: by 10.27.172.143 with HTTP; Wed, 25 Feb 2015 10:13:55 -0800 (PST) Date: Wed, 25 Feb 2015 19:13:55 +0100 Message-ID: Subject: [patch]: Fix regression caused by fix for 61917 From: Kai Tietz To: GCC Patches Cc: Jakub Jelinek X-IsSubscribed: yes Hi, The patch didn't handled the case for dt being vect_constant_def, where of course the reduc_def_stmt is NULL. By checking for NULL before testing for PHI, we now fallback for such cases to old behavior and return in the next if-statment. 2015-02-25 Richard Biener Kai Tietz PR tree-optimization/61917 * tree-vect-loop.c (vectorizable_reduction): Handle obvious case that reduc_def_stmt is null. Tested and will apply as obvious to trunk and 4.9 if there are no objections. Sorry for the noise. Kai Index: tree-vect-loop.c =================================================================== --- tree-vect-loop.c (Revision 220968) +++ tree-vect-loop.c (Arbeitskopie) @@ -4912,7 +4912,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_i if (!found_nested_cycle_def) reduc_def_stmt = def_stmt; - if (gimple_code (reduc_def_stmt) != GIMPLE_PHI) + if (reduc_def_stmt && gimple_code (reduc_def_stmt) != GIMPLE_PHI) return false; if (!(dt == vect_reduction_def