From patchwork Fri Nov 9 12:29:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 995483 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-489510-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="s/WWPFxc"; dkim-atps=neutral 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 42rzwv35BMz9s7W for ; Fri, 9 Nov 2018 23:29:17 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=Wp3boMOtxo50deyBGwCXdYD9vwVc9zJ/2mE6yPPj+vUzlic/b/rXl WVKnf1LQDXSGUgZHvVDH3l591g1q1af/tiRrCSvc1Vo9MnpcwHeIkSF03RJcV3A7 A4fatBi+cLzHAR5dBDbbAgz6BxVaONmkvMvgkzD0JuCIGGjwbiATxU= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=KKv0QgfH1WCH9kHAyHlzPDQS8GY=; b=s/WWPFxciNQWMF3kY1GM GI+GHmkBZWqUpD6Ounq9HmZvCfEcQ6LceAfmDp/M4+oDrLgblFwUMDFr5EsUjaiN HCP1emxaXY9735J8mghYy2yzF9VkTtW86cwWEPI0wOhwJi70SgQH3TRXBO0RrhBP TqWvPxkIex33v62hyOZmNWQ= Received: (qmail 18880 invoked by alias); 9 Nov 2018 12:29:10 -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 18859 invoked by uid 89); 9 Nov 2018 12:29:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:875 X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Nov 2018 12:29:09 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 045A3AD4C for ; Fri, 9 Nov 2018 12:29:06 +0000 (UTC) Date: Fri, 9 Nov 2018 13:29:02 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR87953 Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2018-11-09 Richard Biener PR tree-optimization/87953 * tree-vect-loop.c (vectorizable_reduction): For analysis always pass ops[0] to vectorizable_condition. diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 22bed26609b..dad6524ee2b 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -6525,9 +6525,10 @@ vectorizable_reduction (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, if (code == COND_EXPR) { /* Only call during the analysis stage, otherwise we'll lose - STMT_VINFO_TYPE. */ + STMT_VINFO_TYPE. We'll pass ops[0] as reduc_op, it's only + used as a flag during analysis. */ if (!vec_stmt && !vectorizable_condition (stmt_info, gsi, NULL, - ops[reduc_index], 0, NULL, + ops[0], 0, NULL, cost_vec)) { if (dump_enabled_p ())