From patchwork Thu Jan 31 14:45:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 1034277 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-495020-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Mw5xSAxF"; 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 43r32N0yYnz9sBn for ; Fri, 1 Feb 2019 01:46:03 +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:to:cc :from:subject:date:mime-version:message-id:content-type :content-transfer-encoding; q=dns; s=default; b=N76je0pWtYTtMMV/ /NzjkL1cM6CM+AU5TTQKy5yTxhJRJdqWQ/PfwvTwi08mf6CoIgaZSowMFoqe1i7L 0QR/0R4q02Vjk7T4ijctd/st6LnVZVTHRbh6tDRqB18Gb3L4mw2vQed76TkTHFN3 WH+5fPfOfFCqi3sjDfTO0+UxV/s= 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:to:cc :from:subject:date:mime-version:message-id:content-type :content-transfer-encoding; s=default; bh=4MRssWlxfpGpgW5yk85fP+ jIsiU=; b=Mw5xSAxFAaBbgB4ghqgBzbqAG+gjrIeuJu58ilRie4RHLnxYEfk4D0 iuKQP5OneNWXnSnfZgsno/Pae4dXuLdyjE6CI9aVSy3JU/y9izSofAoqlke8NwZa ueb2NSWpEZV28SUakHiSLRfS6FiPFpSqVriwVW0YC83kZ+/eBvG2Q= Received: (qmail 71910 invoked by alias); 31 Jan 2019 14:45:56 -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 71779 invoked by uid 89); 31 Jan 2019 14:45:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, HTML_MESSAGE, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=observes, interpretation, portion, H*c:alternative X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 Jan 2019 14:45:54 +0000 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0VEhkf6030079 for ; Thu, 31 Jan 2019 09:45:52 -0500 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qc1prcqqa-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 Jan 2019 09:45:52 -0500 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 Jan 2019 14:45:50 -0000 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 31 Jan 2019 14:45:48 -0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x0VEjlOS14811182 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 31 Jan 2019 14:45:48 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BEB68112063; Thu, 31 Jan 2019 14:45:47 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6C86D112061; Thu, 31 Jan 2019 14:45:47 +0000 (GMT) Received: from BigMac.local (unknown [9.80.223.74]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 31 Jan 2019 14:45:47 +0000 (GMT) To: GCC Patches Cc: Richard Biener From: Bill Schmidt Subject: [PATCH, committed] Fix SLSR portion of PR89008 Date: Thu, 31 Jan 2019 08:45:46 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 x-cbid: 19013114-0060-0000-0000-000003038285 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010510; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000277; SDB=6.01154379; UDB=6.00601951; IPR=6.00934808; MB=3.00025370; MTD=3.00000008; XFM=3.00000015; UTC=2019-01-31 14:45:49 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19013114-0061-0000-0000-00004820CE66 Message-Id: <67bd1180-5dc0-0ed2-9e94-8c67a61d0159@linux.ibm.com> Hi, PR89008 observes that SLSR gets confused when provided with an expression of the form X * 0. The bug is currently latent on trunk, gcc 8, and gcc 7. This patch avoids placing such expressions in SLSR's candidate table, since they aren't of any use anyway. Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no regressions. Tested on an older revision where the bug was observable and found to fix the problem. Committed, backports pending. Thanks, Bill 2018-01-31 Bill Schmidt PR tree-optimization/89008 * gimple-ssa-strength-reduction.c (slsr_process_mul): Don't process anything of the form X * 0. Index: gcc/gimple-ssa-strength-reduction.c =================================================================== --- gcc/gimple-ssa-strength-reduction.c (revision 268411) +++ gcc/gimple-ssa-strength-reduction.c (working copy) @@ -1268,7 +1268,7 @@ slsr_process_mul (gimple *gs, tree rhs1, tree rhs2 c->next_interp = c2->cand_num; c2->first_interp = c->cand_num; } - else if (TREE_CODE (rhs2) == INTEGER_CST) + else if (TREE_CODE (rhs2) == INTEGER_CST && !integer_zerop (rhs2)) { /* Record an interpretation for the multiply-immediate. */ c = create_mul_imm_cand (gs, rhs1, rhs2, speed);