From patchwork Sat Jul 14 19:16:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Koning X-Patchwork-Id: 943988 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-481557-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=comcast.net Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ZC+iBuSu"; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=comcast.net header.i=@comcast.net header.b="YStNUTkr"; 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 41SfZ46BzNz9s0n for ; Sun, 15 Jul 2018 05:17:13 +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:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:to; q=dns; s=default; b=dG3eIYdDN2Yy1iiHfi3+b5M lBXQBWuQH9Wha5kiCWZEjhIo2H/+3SE/2oVu+j6HfbnQuHtTBaScM9b4z2A+/f13 5PuKRuOgYQADzj3Oc8H9go+nYuL18Hr7NZVZ54AQGtRmm/dHGVboIZwLILU404Uz y3SqIsqDNm70YGneGSA8= 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:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:to; s=default; bh=/osLf8nAWEQ4R018Xtw6nut20T0=; b= ZC+iBuSuI4IVsKCuoFifsPRDEo1oZ64MT64ak+gr0Fp8/9xrrsqPg4d4cPMe8bZA GLT/1Amz/bZFTf0JWY4IN+9Fie3Hrr73yuLcSsEN08KgJexwqm/3c2vohFzn3EJZ ygSvt5QJBG5k5MaPUxLebUqYHX7CVyIxVE92Ujpi5IY= Received: (qmail 122504 invoked by alias); 14 Jul 2018 19:17:06 -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 122470 invoked by uid 89); 14 Jul 2018 19:17:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=D*arrl.net, ni1d@arrl.net, ni1darrlnet, U*ni1d X-HELO: resqmta-ch2-07v.sys.comcast.net Received: from resqmta-ch2-07v.sys.comcast.net (HELO resqmta-ch2-07v.sys.comcast.net) (69.252.207.39) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 14 Jul 2018 19:17:01 +0000 Received: from resomta-ch2-14v.sys.comcast.net ([69.252.207.110]) by resqmta-ch2-07v.sys.comcast.net with ESMTP id ePgCfZBcja4FQeQ2OfkZnq; Sat, 14 Jul 2018 19:17:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1531595820; bh=89zJI1yhlOxR66genJXmr2z5MbB8WIhncU8O45FsMBI=; h=Received:Received:From:Content-Type:Mime-Version:Subject: Message-Id:Date:To; b=YStNUTkrxa3jXe5IbrMMlIrC7bCh774hC95uSwmK2MCxZR3WrunqHRktQo2N0yJ+J u08N5bE6JiEUCxhp18a6TD5AlGkrvpVswA0MXjRRPPYU8eI0FWE5c2drvWA6V6TTDv Qy0Ua/tzLC+/YMW7SgSydLK61zRet3IHiX+kU/4Ktz54OlNjeJlpUUddI3AdgPN8gA tGRF6FP1k+dGdPSu0pXPais6yvMQ8Ge0zkGSA1jBxA6Z1HyH6Cb23PSm3wOoLzH8Y5 qYdx4O2iYH+kgWvz8tRUfqhb2dXlxvz9hPDD52RGuIgGzHjviLMPyWvzNDBF+7O8Ag oL21kChxEiQlQ== Received: from pkoning.akdesign.com ([73.60.223.101]) by resomta-ch2-14v.sys.comcast.net with ESMTPA id eQ2Mfg0RO0f2neQ2NfTJ37; Sat, 14 Jul 2018 19:16:59 +0000 From: Paul Koning Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: [PATCH, committed] Fix rtl check error in pdp11 Message-Id: <94826AE9-EF80-4E8F-B85B-2E2609475EA7@comcast.net> Date: Sat, 14 Jul 2018 15:16:57 -0400 To: GCC Patches When building with checking enabled, there were check failures in pdp11_rtx_costs. This patch fixes two errors. Committed. paul ChangeLog: 2018-07-14 Paul Koning * config/pdp11/pdp11.c (pdp11_rtx_costs): Bugfixes. Index: config/pdp11/pdp11.c =================================================================== --- config/pdp11/pdp11.c (revision 262604) +++ config/pdp11/pdp11.c (working copy) @@ -1014,6 +1014,7 @@ pdp11_rtx_costs (rtx x, machine_mode mode, int out const int code = GET_CODE (x); const int asize = (mode == QImode) ? 2 : GET_MODE_SIZE (mode); rtx src, dest; + const char *fmt; switch (code) { @@ -1035,6 +1036,14 @@ pdp11_rtx_costs (rtx x, machine_mode mode, int out *total = pdp11_addr_cost (x, mode, ADDR_SPACE_GENERIC, speed); return true; } + if (GET_RTX_LENGTH (code) == 0) + { + if (speed) + *total = 0; + else + *total = 2; + return true; + } /* Pick up source and dest. We don't necessarily use the standard recursion in rtx_costs to figure the cost, because that would @@ -1041,6 +1050,15 @@ pdp11_rtx_costs (rtx x, machine_mode mode, int out count the destination operand twice for three-operand insns. Also, this way we can catch special cases like move of zero, or add one. */ + fmt = GET_RTX_FORMAT (code); + if (fmt[0] != 'e' || (GET_RTX_LENGTH (code) > 1 && fmt[1] != 'e')) + { + if (speed) + *total = 0; + else + *total = 2; + return true; + } if (GET_RTX_LENGTH (code) > 1) src = XEXP (x, 1); dest = XEXP (x, 0);