From patchwork Wed Jul 17 07:05:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1133138 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-505176-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="gM4flpBW"; 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 45pSw63lwtz9sMQ for ; Wed, 17 Jul 2019 17:05:41 +1000 (AEST) 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=TR8/IRS/QaSQMOezvtSznn5LsKoUAMgXRwI5ykGBCxNbVLifDN7Ga iznrqAmw4MjTrMZWO8oiKUW0y01cos6LIWdlvqhSnPCfIRNC4xEp5+4+PxHWCidh VvMt5uoJpUK+ZU1GcGhR5L3ax4Q0fOapTF71XgfkmLZ2/868WOJLuM= 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=dI2I9QRL69yO+/GXQU7rDem1Lgk=; b=gM4flpBWixqFcMCJZje1 QJmiXMg580cfRiXjVoT1mzOzAW2rHfd9cUHEq/9/jPlHnys9xQN07H5O4ZtLbptC DVmlSl4KA/pWQFZK+R9YzhLBjcrq37uHH7j+Zau21ZMrgmy4drNQI4r3iMxIQBgM OFqzZMq92HRVM3q7dy2GJKE= Received: (qmail 102266 invoked by alias); 17 Jul 2019 07:05:34 -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 102257 invoked by uid 89); 17 Jul 2019 07:05:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_NUMSUBJECT, SPF_PASS autolearn=ham version=3.3.1 spammy= 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; Wed, 17 Jul 2019 07:05:33 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id F035FADDC for ; Wed, 17 Jul 2019 07:05:30 +0000 (UTC) Date: Wed, 17 Jul 2019 09:05:30 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR91181 Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Bootstrapped / tested on x86_64-unknown-linux-gnu, applied. Richard. 2019-07-17 Richard Biener PR tree-optimization/91181 * tree-vect-slp.c (vect_build_slp_tree_1): Do not compare IFN_LOADs as calls. * gcc.dg/pr91181.c: New testcase. Index: gcc/tree-vect-slp.c =================================================================== --- gcc/tree-vect-slp.c (revision 273490) +++ gcc/tree-vect-slp.c (working copy) @@ -857,7 +857,7 @@ vect_build_slp_tree_1 (unsigned char *sw continue; } - if (rhs_code == CALL_EXPR) + if (!load_p && rhs_code == CALL_EXPR) { if (!compatible_calls_p (as_a (stmts[0]->stmt), as_a (stmt))) Index: gcc/testsuite/gcc.dg/pr91181.c =================================================================== --- gcc/testsuite/gcc.dg/pr91181.c (nonexistent) +++ gcc/testsuite/gcc.dg/pr91181.c (working copy) @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-Ofast" } */ +/* { dg-additional-options "-mavx" { target x86_64-*-* i?86-*-* } } */ + +enum { a, b, c }; +float *d, *e; +int f, g, h, i; +int j() +{ + float a; + for (; h; h++) + { + i = h * 4; + a = d[i + b]; + if (a) { + e[i + b] = g < d[i + b] * f * a ? g : d[i + b] * f * a; + e[i + c] = g < d[i + c] * f * a ? g : d[i + c] * f * a; + } + e[i + b] = e[i + c]; + } +}