From patchwork Sat May 13 23:23:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Reutner-Fischer X-Patchwork-Id: 93620 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp6015262vqo; Sat, 13 May 2023 16:25:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/BcUdoDOI7jHULLGNrqsKpK0QAPuWGJm7Z+UAlFLx0JCdZMsEv+ZJmhAG5cwe6H9RYjo/ X-Received: by 2002:a17:907:6e8e:b0:94f:3521:396 with SMTP id sh14-20020a1709076e8e00b0094f35210396mr31682090ejc.23.1684020317818; Sat, 13 May 2023 16:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684020317; cv=none; d=google.com; s=arc-20160816; b=neiG1JNZBVFVzyhszpXCfvHTsQ+dqFZ5/hJaRmQte/kSuZPnpXbumncz63ygJ7vBq0 ZJa8XhK4Xr2IcM9ZBG0ja0V4Y/QYwgABH+bkgL9TyjOxXe4EaWgX5P78oSbnauhuJXPm 0+wPJuju7wcwtPMR2h3NcR7xSe/jE9vCIQvX8C62kq08etxmbD1ttAsBmRyigJCnQrwM qtmhyUYDrLRLBRvKGtM+8F0rf84vXtHAmtvT8rSz1KI819l3XoujAMF9F8QvVn3Ut+jn Ca9cPHa+lgzQee8VlrNuVb1JzScfbMW3KC7CUQR3ClGkVeMCOzGcS6y4nYNWo2sYa49f 8cPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=hT7lJZNRWjjnNZozsnbzkPggov69uoecQAgXTLAydvY=; b=cu2fML49Vwft/4kP2vSWXYe8L1hVCEOlK3rXStGiz8c7TdcJQbFPlcla4u+V8TodP/ ENqbunvbliv+Zc5i2419nOtDM3n8MPQqFuI+5HplwlYYggCGqVwcNjqu/0GWlbpktkwR lAXLGjaQBkx/+/HlEvW9P2IfkwdTovmfhVdb0aWh0KmsZtwlkyJFOu29G7YhpMShTQ9x KAeQyG5QFYn9Gogjqt0ClmIxqjZuRO8oWKdJIybMEbga+m6hx41+SemG8SIZKyalOgUx c26JBK1umhjH/UDMbL1pTJF9GW+Q0JPBVCL8qYCv+lUwN/6RW3JC9TMGJOBlfGr89+WY n5oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=afqC8+qz; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ib10-20020a1709072c6a00b0094a6863fddfsi10097877ejc.430.2023.05.13.16.25.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 May 2023 16:25:17 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=afqC8+qz; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7F7FE3854156 for ; Sat, 13 May 2023 23:24:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F7FE3854156 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684020280; bh=hT7lJZNRWjjnNZozsnbzkPggov69uoecQAgXTLAydvY=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=afqC8+qzz201hXN2zvyW0giLuEa1pYzk7oJC6a1CR1ih/nButb5/WS9swS32P3jBb qeTB0UohgC04alyhRoTsUktorScI7zP7dMQhno2QOYH2g5IVwy4RlwADrpWPQIE1Lj 0WC/6DKeevt3tDwwowZVR+MKhrXLKs9h4QrPwGo8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id 2FA4E385840D; Sat, 13 May 2023 23:23:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2FA4E385840D Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-966400ee79aso1637701466b.0; Sat, 13 May 2023 16:23:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684020230; x=1686612230; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hT7lJZNRWjjnNZozsnbzkPggov69uoecQAgXTLAydvY=; b=Tf3UMbgKhazSqVOAw9UbT4Iia37nswFWRJVBYrWeSSQt6E+LkRTKKas4ajo8PxXdOh 4Pb95bGPakTwaSA1WcndSvt2DirGfaFitMn2sMKcf6rZ8E2igNKO3+Lrfs41G3tBZnZh Fd68xGXSe7eSqz9BCAkkrFXdS8D3ZAEKObGJZ7B5brLZTB6pN1yxPLEGbG2YpUEyde7k ENs4U2G++5nxzfwhva8R8LoxG9O4Mq7zzdjIP5RblazGanBlC0XU3UStFs2DQiVCTEVt LOtifRPL8sruqFzSB6hWCOY783VySow4fmWz8qIb0gdGVTWUVH/r7hJgXPgxRxr8tyNZ sPqg== X-Gm-Message-State: AC+VfDyMlv39D7OqvVXRijkvLGfc9x2ynTQRkUXoXYT+eGN9DL1SluqE Ck9MBt5dIYWV8FY0Hgr/CtU23WOWNn4= X-Received: by 2002:a17:907:9816:b0:96a:77a2:bba with SMTP id ji22-20020a170907981600b0096a77a20bbamr10435462ejc.60.1684020229984; Sat, 13 May 2023 16:23:49 -0700 (PDT) Received: from nbbrfq ([2001:871:227:ce8b:afc3:c345:e1dd:564e]) by smtp.gmail.com with ESMTPSA id hx7-20020a170906846700b00965a4350411sm7248506ejc.9.2023.05.13.16.23.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 May 2023 16:23:48 -0700 (PDT) Received: from b by nbbrfq with local (Exim 4.96) (envelope-from ) id 1pxyaa-001Amf-0E; Sun, 14 May 2023 01:23:48 +0200 To: gcc-patches@gcc.gnu.org Cc: Bernhard Reutner-Fischer Subject: [PATCH 07/14] d: use _P() defines from tree.h Date: Sun, 14 May 2023 01:23:14 +0200 Message-Id: <20230513232321.279733-8-rep.dot.nop@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230513232321.279733-1-rep.dot.nop@gmail.com> References: <20230513232321.279733-1-rep.dot.nop@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Bernhard Reutner-Fischer via Gcc-patches From: Bernhard Reutner-Fischer Reply-To: Bernhard Reutner-Fischer Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765823289015605249?= X-GMAIL-MSGID: =?utf-8?q?1765823289015605249?= From: Bernhard Reutner-Fischer gcc/d/ChangeLog: * d-codegen.cc (underlying_complex_expr): Use _P defines from tree.h. * d-convert.cc (convert): Ditto. (convert_for_rvalue): Ditto. --- gcc/d/d-codegen.cc | 2 +- gcc/d/d-convert.cc | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/gcc/d/d-codegen.cc b/gcc/d/d-codegen.cc index 5c6c300ecec..9bae06077b5 100644 --- a/gcc/d/d-codegen.cc +++ b/gcc/d/d-codegen.cc @@ -1599,7 +1599,7 @@ underlying_complex_expr (tree type, tree expr) /* Build a constructor from the real and imaginary parts. */ if (COMPLEX_FLOAT_TYPE_P (TREE_TYPE (expr)) && (!INDIRECT_REF_P (expr) - || !CONVERT_EXPR_CODE_P (TREE_CODE (TREE_OPERAND (expr, 0))))) + || !CONVERT_EXPR_P (TREE_OPERAND (expr, 0)))) { vec *ve = NULL; CONSTRUCTOR_APPEND_ELT (ve, TYPE_FIELDS (type), diff --git a/gcc/d/d-convert.cc b/gcc/d/d-convert.cc index 9e7fcd506f8..cdbd69cf012 100644 --- a/gcc/d/d-convert.cc +++ b/gcc/d/d-convert.cc @@ -257,7 +257,7 @@ convert (tree type, tree expr) return fold_convert (type, expr); if (TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK) return error_mark_node; - if (TREE_CODE (TREE_TYPE (expr)) == VOID_TYPE) + if (VOID_TYPE_P (TREE_TYPE (expr))) { error ("void value not ignored as it ought to be"); return error_mark_node; @@ -270,8 +270,7 @@ convert (tree type, tree expr) case INTEGER_TYPE: case ENUMERAL_TYPE: - if (TREE_CODE (etype) == POINTER_TYPE - || TREE_CODE (etype) == REFERENCE_TYPE) + if (POINTER_TYPE_P (etype)) { if (integer_zerop (e)) return build_int_cst (type, 0); @@ -300,7 +299,7 @@ convert (tree type, tree expr) return fold (convert_to_real (type, e)); case COMPLEX_TYPE: - if (TREE_CODE (etype) == REAL_TYPE && TYPE_IMAGINARY_FLOAT (etype)) + if (SCALAR_FLOAT_TYPE_P (etype) && TYPE_IMAGINARY_FLOAT (etype)) return fold_build2 (COMPLEX_EXPR, type, build_zero_cst (TREE_TYPE (type)), convert (TREE_TYPE (type), expr)); @@ -656,7 +655,7 @@ convert_for_rvalue (tree expr, Type *etype, Type *totype) && ebtype->ty == TY::Tsarray && tbtype->nextOf ()->ty == ebtype->nextOf ()->ty && INDIRECT_REF_P (expr) - && CONVERT_EXPR_CODE_P (TREE_CODE (TREE_OPERAND (expr, 0))) + && CONVERT_EXPR_P (TREE_OPERAND (expr, 0)) && TREE_CODE (TREE_OPERAND (TREE_OPERAND (expr, 0), 0)) == ADDR_EXPR) { /* If expression is a vector that was casted to an array either by