From patchwork Tue Aug 15 05:19:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 135622 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:3f2:4152:657d with SMTP id x8csp215604vqo; Mon, 14 Aug 2023 22:20:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1kWj9EC2Rivr9yjI03TdEqh6/KXXGasSRm8nx02+PUHCt+5nrj6N6ne7OnEeZItNRIAq/ X-Received: by 2002:a17:906:1d:b0:99c:e38d:e47d with SMTP id 29-20020a170906001d00b0099ce38de47dmr10951980eja.27.1692076836708; Mon, 14 Aug 2023 22:20:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692076836; cv=none; d=google.com; s=arc-20160816; b=t1KNST1f2KLAQxmXqoka8dcJnLSjU8ZGu9qe9EDbP6AXuTQPniwdPXX2VYFrckXdn+ Mkov/lNjaha4+HD6HrLykWF20agpeiqajaZv1AlEPhnDzsvpbXQ5eZaVuyZqVUbVUrg2 JbCju1gd3ihgmZzdXT1LFXM/mR8H83i+9xpkFMlvfy1gUmHsTJscqtQfr9NGMCKZP8MZ O/3ISMyScLACibLcmPrWtYqMnt9d+n++FYh3qSv1Y3pbXksgpuPCgFEpyl86AZLMEdPA OQUnu15YWYlxXUeHd8aaeByy3qXj03KRl8qcaAthVY2DyHC74P5TJqPN2JZ1LfSIyM/g S43Q== 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:date:message-id :content-transfer-encoding:mime-version:subject:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=I/PmiB8wpuH1iTnKYr6Rh+9nDYx8pF63eQOj+BaWUbk=; fh=8Ti0qFBl9c1ZVljZbRj/II9JRW0XTAg95cp4xVYqVSU=; b=ZXUNNq3+Re/huNRjdgcVP/TEdoYs+D3mj5+yGLZY2aWgwGAwWXUv50xv8KplNbACOM U8HliYs40Tpkq3ryqGTQbjrDgTp5bJLUkhpExh22X63p4I1yhzikdSx5J85oqXczAi9I PWZisIhbr+93aOtS5NQw+GJDiBGSdKkaWFqLraxUcCFVsG/dyK27IEwK/VBY8bJDoVWF 2DNct3E2FK5/438RbXLLDfgE+ciaV7lfLE72WYjRPPW+zFAcMjrxA09Ns9C5IhjqaMWm zjwgJSSmHTVHqvRibighAABm1Xznp5wEB3lTFDtWNGtHDF2jzRDLOssUIKW1gauwHBen 370A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="qpRtd/Vh"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ss15-20020a170907038f00b00991c46d0bb6si8247475ejb.93.2023.08.14.22.20.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 22:20:36 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="qpRtd/Vh"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 8C6233858032 for ; Tue, 15 Aug 2023 05:20:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C6233858032 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692076835; bh=I/PmiB8wpuH1iTnKYr6Rh+9nDYx8pF63eQOj+BaWUbk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=qpRtd/VhH7+RfyhhPHjjR6rj//5oflkH48dS7h9hV8yiGeI5alq+HQo1/e3gm/cKa eCKwXD3UqliMGPKhd7J7cGvdBayivUWsh5LPN7O6EV6TtrOEu55Il3HyP0vbCKCron TskC0xR/m7RaFl7pxR+vK+pWV84dOofN/BunSBL4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id 8364F3858422 for ; Tue, 15 Aug 2023 05:19:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8364F3858422 To: Subject: [PATCH v2] CRIS: Don't include tree.h in cris-protos.h, PR bootstrap/111021 MIME-Version: 1.0 Message-ID: <20230815051952.6488F203F1@pchp3.se.axis.com> Date: Tue, 15 Aug 2023 07:19:52 +0200 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, SPF_HELO_PASS, SPF_PASS, TXREP 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: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774269728659105689 X-GMAIL-MSGID: 1774271161147351400 Re-testing as previously mentioned, reposted freshly for reference. -- >8 -- While there's another patch that fixes the immediate error in the PR by other means, the include of tree.h here is something I prefer to avoid. PR bootstrap/111021 * config/cris/cris-protos.h: Revert recent change. * config/cris/cris.cc (cris_legitimate_address_p): Remove code_helper unused parameter. (cris_legitimate_address_p_hook): New wrapper function. (TARGET_LEGITIMATE_ADDRESS_P): Change to cris_legitimate_address_p_hook. --- gcc/config/cris/cris-protos.h | 5 +---- gcc/config/cris/cris.cc | 13 +++++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gcc/config/cris/cris-protos.h b/gcc/config/cris/cris-protos.h index 58555943986c..666e04f9eeec 100644 --- a/gcc/config/cris/cris-protos.h +++ b/gcc/config/cris/cris-protos.h @@ -20,8 +20,6 @@ along with GCC; see the file COPYING3. If not see /* Prototypes for the CRIS port. */ -#include "tree.h" /* For ERROR_MARK. */ - extern bool cris_simple_epilogue (void); #ifdef RTX_CODE extern const char *cris_op_str (rtx); @@ -36,8 +34,7 @@ extern bool cris_base_or_autoincr_p (const_rtx, bool); extern bool cris_bdap_index_p (const_rtx, bool); extern void cris_reduce_compare (rtx *, rtx *, rtx *); extern bool cris_biap_index_p (const_rtx, bool); -extern bool cris_legitimate_address_p (machine_mode, rtx, bool, - code_helper = ERROR_MARK); +extern bool cris_legitimate_address_p (machine_mode, rtx, bool); extern bool cris_store_multiple_op_p (rtx); extern bool cris_movem_load_rest_p (rtx); extern void cris_asm_output_symbol_ref (FILE *, rtx); diff --git a/gcc/config/cris/cris.cc b/gcc/config/cris/cris.cc index 853c07920f07..4eaaf2184b63 100644 --- a/gcc/config/cris/cris.cc +++ b/gcc/config/cris/cris.cc @@ -168,6 +168,8 @@ static unsigned int cris_hard_regno_nregs (unsigned int, machine_mode); static bool cris_hard_regno_mode_ok (unsigned int, machine_mode); static HOST_WIDE_INT cris_static_rtx_alignment (machine_mode); static HOST_WIDE_INT cris_constant_alignment (const_tree, HOST_WIDE_INT); +static bool cris_legitimate_address_p_hook (machine_mode, rtx, bool, + code_helper); /* This is the parsed result of the "-max-stack-stackframe=" option. If it (still) is zero, then there was no such option given. */ @@ -217,7 +219,7 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION; #define TARGET_INIT_LIBFUNCS cris_init_libfuncs #undef TARGET_LEGITIMATE_ADDRESS_P -#define TARGET_LEGITIMATE_ADDRESS_P cris_legitimate_address_p +#define TARGET_LEGITIMATE_ADDRESS_P cris_legitimate_address_p_hook #undef TARGET_PREFERRED_RELOAD_CLASS #define TARGET_PREFERRED_RELOAD_CLASS cris_preferred_reload_class @@ -1536,8 +1538,15 @@ cris_biap_index_p (const_rtx x, bool strict) /* Worker function for TARGET_LEGITIMATE_ADDRESS_P. */ +static bool +cris_legitimate_address_p_hook (machine_mode mode, rtx x, bool strict, + code_helper) +{ + return cris_legitimate_address_p (mode, x, strict); +} + bool -cris_legitimate_address_p (machine_mode mode, rtx x, bool strict, code_helper) +cris_legitimate_address_p (machine_mode mode, rtx x, bool strict) { const_rtx x1, x2;