From patchwork Fri Jul 30 11:01:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1511617 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=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=BNW49siF; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GblBG675hz9sXk for ; Fri, 30 Jul 2021 21:13:10 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 90FFC393F826 for ; Fri, 30 Jul 2021 11:13:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 90FFC393F826 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1627643588; bh=79WtGSLOvKH+enLDWktF87D7afC1fRvpQRu+f6eU03k=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=BNW49siFUjD7hIdCFJsKBYIBfWH0pY28qF0FolCixIk20oDdyZ5i5jxFHoUheoKr9 y/PDOqBWhMwEKmzZ4miO6SQCSgdx3f/ix2+gYq3oIfJnm5iUsfvnfX8SG/oiJSeDY8 gD1Rux77xASy0SntzKeZwrpDdtfADU9yB5xcgt2U= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by sourceware.org (Postfix) with ESMTPS id 91036393D01A for ; Fri, 30 Jul 2021 11:01:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 91036393D01A Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4Gbkwy4cnnzQk29; Fri, 30 Jul 2021 13:01:38 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id osxg6eU2vSBE; Fri, 30 Jul 2021 13:01:32 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [committed 12/12] d: Remove dead code from binary_op. Date: Fri, 30 Jul 2021 13:01:11 +0200 Message-Id: <20210730110111.569140-12-ibuclaw@gdcproject.org> In-Reply-To: <20210730110111.569140-1-ibuclaw@gdcproject.org> References: <20210730110111.569140-1-ibuclaw@gdcproject.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: E483E1847 X-Rspamd-UID: 0842b0 X-Spam-Status: No, score=-15.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Buclaw via Gcc-patches From: Iain Buclaw Reply-To: Iain Buclaw Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" The front-end ensures that both sides have been casted to the same type before being given to the lowering pass. gcc/d/ChangeLog: * expr.cc (binary_op): Remove dead code. --- gcc/d/expr.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc index 73e0abeaa43..e293cf2a4cd 100644 --- a/gcc/d/expr.cc +++ b/gcc/d/expr.cc @@ -101,8 +101,6 @@ binary_op (tree_code code, tree type, tree arg0, tree arg1) tree t1 = TREE_TYPE (arg1); tree ret = NULL_TREE; - bool unsignedp = TYPE_UNSIGNED (t0) || TYPE_UNSIGNED (t1); - /* Deal with float mod expressions immediately. */ if (code == FLOAT_MOD_EXPR) return build_float_modulus (type, arg0, arg1); @@ -130,12 +128,6 @@ binary_op (tree_code code, tree type, tree arg0, tree arg1) else ret = fold_build2 (POINTER_DIFF_EXPR, ptrtype, arg0, arg1); } - else if (INTEGRAL_TYPE_P (type) && (TYPE_UNSIGNED (type) != unsignedp)) - { - tree inttype = (unsignedp) - ? d_unsigned_type (type) : d_signed_type (type); - ret = fold_build2 (code, inttype, arg0, arg1); - } else { /* If the operation needs excess precision. */