From patchwork Fri Nov 22 12:58:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 1199466 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-514397-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=t-online.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="IMsvb2sV"; 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 47KGhS0xwDz9sPL for ; Fri, 22 Nov 2019 23:58:45 +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 :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=Cm6TArERiiZLkW/iqY5Dz9cpwEitqXr0Qy3iB082/IiyxgQ8lw JlQ+uwGMtReGAHfJSxogRBW9mecaUV88gHWSdtETGekmNZjCVX+eUNNpYB3UGFCF iuK1AC36yI00BcRvEmKATMtUx5gPrWTDJ8S7slLAtRv96MAg2l274izUA= 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 :from:subject:message-id:date:mime-version:content-type; s= default; bh=eOzDEHY3U9V/4Cj6yaDHsaLw908=; b=IMsvb2sVWMZtwvv+bvhx QySSoeGKASiq5n5kYZSvPMQ86uioAUex5hcKqeiyKW/erXcb3XaFfaXRwi3RZvwd rftgRelWCIZLBIO15ABQM34+qK0T/Kd3Hmj4VIbWWKX9zpnHerL9okce6iDIlFdm L4O33IAiCK4n0s1qkhrB1UA= Received: (qmail 101386 invoked by alias); 22 Nov 2019 12:58:37 -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 101338 invoked by uid 89); 22 Nov 2019 12:58:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_JMF_BL, SPOOFED_FREEMAIL autolearn=ham version=3.3.1 spammy=H*M:online, H*MI:online, HX-HELO:sk:mailout, H*Ad:D*t-online.de X-HELO: mailout06.t-online.de Received: from mailout06.t-online.de (HELO mailout06.t-online.de) (194.25.134.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 Nov 2019 12:58:35 +0000 Received: from fwd22.aul.t-online.de (fwd22.aul.t-online.de [172.20.26.127]) by mailout06.t-online.de (Postfix) with SMTP id ABDDA412D75C; Fri, 22 Nov 2019 13:58:32 +0100 (CET) Received: from sweetums.local (ZGomYvZCrh2EsJe1csYOMtIAOr5s6J1Ky4aW2DueDrRx-3HlPiy2sja6EEW4i55QVl@[84.128.94.135]) by fwd22.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1iY8W3-2eqGjw0; Fri, 22 Nov 2019 13:58:27 +0100 To: GCC Patches , Uros Bizjak From: Bernd Schmidt Subject: [PATCH ix86] Fix rtx_costs for flag-setting adds Openpgp: preference=signencrypt Message-ID: <29c1ed2a-10b0-63c9-cfe1-942b1a35e844@t-online.de> Date: Fri, 22 Nov 2019 13:58:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 X-IsSubscribed: yes A patch I posted recently fixes combine to take costs of JUMP_INSNs into account. That causes the pr30315 test to fail with -m32, since the cost of an add that sets the flags is estimated too high. The following seems to fix it. Bootstrapped and tested on x86_64-linux, ok? Bernd * config/i386/i386.c (ix86_rtx_costs): For a PLUS inside a COMPARE, representing an add that sets the flags, count just the PLUS. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 7115ec44c2a..6e48f5ccbde 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -19500,6 +19500,11 @@ ix86_rtx_costs (rtx x, machine_mode mode, int outer_code_i, int opno, + rtx_cost (const1_rtx, mode, outer_code, opno, speed)); return true; } + if (GET_CODE (XEXP (x, 0)) == PLUS) + { + *total = rtx_cost (XEXP (x, 0), mode, COMPARE, 0, speed); + return true; + } /* The embedded comparison operand is completely free. */ if (!general_operand (XEXP (x, 0), GET_MODE (XEXP (x, 0)))