From patchwork Sat Nov 18 17:45:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Ruoyao X-Patchwork-Id: 166608 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp1298080vqn; Sat, 18 Nov 2023 09:50:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFpmZZZ8Chjx5j0LgO8ljqZJRRlP27lpRKK0CeGFEDpDY9I0DZMcO8v1u0NcyoSrfV4PbnR X-Received: by 2002:a81:9249:0:b0:5a8:1aa2:1ac1 with SMTP id j70-20020a819249000000b005a81aa21ac1mr2673969ywg.12.1700329830440; Sat, 18 Nov 2023 09:50:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700329830; cv=pass; d=google.com; s=arc-20160816; b=svlJRbkGDcmPJ2Zz76DRKNQYT5tVTbLXBJEXjRyrYvme4q58US2fBjCtV0nNB2N0LS biBJvOGlOQZeF0r5WX2xmwaqjal+pTq1m6/OPjKHoNT5Pri4pPzL6U5Dp0saR88SJoyv A7G9/59+dP8Xwaj8KFu9Sv6TUbrZZn8pmyi2wheTcvyOvd1ebJd+mCdqVuPwkJ85RU3o RTRu9qiN8p2jwlmv+iZgm53MQZWsJ+/uK4Et8AcafSUgReW8aVCrZdPlUE+hRYp9SK8A gNShGatBhdznj0lvXRWtBFfEFeqoJRC2n/KUOh81MyOkk9HyPplS8wwbRJnJXins/Ceh f/KA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=Ecj9Jp1pJKa6rzxx+N/JU0EaS2z3XQzYoDH53OF8TpA=; fh=oUCfM/eMlWtMCtZZKY1bglzxCo7b3kw9D5LTFFWuz38=; b=W0KzELnpIGyIX0/Y1bkRXNr2OG2q/xp/tKwTNn2Pj6jBNiN7iWLh0uXZESFHA+TQXx n7FIqDPwIM3EnaGcZaESm1yfVS2nxpc8Zq+OklpIuPQswLuSuPWuPYr5e5qfX4OEkNP5 uq5PS8qv+kZEPHSAww4T8DN142RBatdsbBXgaGbIhrptzkvVHisqKqZP0vJfQIYFxlMr LeqJXupVj59V6OIBVImQNSiHyUcdAu/CaQ6t2v0sHJ4zkoObL/FNszpnxlGkL6cKl/xR zRMCvfxfXWwmur3Kk1vRZoUoukhDzBL8YXGf3EoTKZqMcdNbaTF40YWQlPOMMtxQ9OTk 61EQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=F3sLpjBI; arc=pass (i=1); 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=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id b16-20020a056214115000b0066d14c995e7si3912704qvt.359.2023.11.18.09.50.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 09:50:30 -0800 (PST) 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=@xry111.site header.s=default header.b=F3sLpjBI; arc=pass (i=1); 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=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 380963858414 for ; Sat, 18 Nov 2023 17:50:30 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 59B983858D32 for ; Sat, 18 Nov 2023 17:50:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 59B983858D32 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 59B983858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=89.208.246.23 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700329807; cv=none; b=w8ju5ZU5KdPq2z3+MY4W99BNkTkdQfctsJNeo5zo5T8L3HWPSrwEQkZOe2YsGXFybnyNXtri8835EaEjZoRPUIBN55bWhMMeIiiTg4S4eXpfmB3BOZ1BoGi/Y5NNQGWlNmTGFW8KXoN2CGOKvOGsLp/+b+aWC0xK+WclsX9Z/LI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700329807; c=relaxed/simple; bh=esat9NltwxlV9Y//5xHIh/mAyNLEt8GIwEYyS0ZR4Dc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=nLyDGMvlV42DIyN1XWcQXWbmWmbTwHp5DbyfQ+E3l9/6y+MrfGtY4G7dTHei/hdkJ7bu4l9Sjy7mgcOBq8+Dsuwj0xw+rrLmP23+cP+mi+Cm1yp0gD1rThNH/9ZF2iIL/eZC7RPOJwXaLdH1auS/6hdMQbEEey1kbArhOPEmkhw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1700329805; bh=esat9NltwxlV9Y//5xHIh/mAyNLEt8GIwEYyS0ZR4Dc=; h=From:To:Cc:Subject:Date:From; b=F3sLpjBIX78B/VRD0SL0g64u8m8IvAGXmttczN8o4xPHv8z4OMVohQzC9+6l45NG9 +99bK0LjbDC5JTg0nQytse8u80bMgYfrKyIHMGJtQkqmr22hGWNZ3+OXkcf8Dj0O7o D/OcTeEJFD7+4gRSVdKoIezXEJJGbScyAVGKCiAw= Received: from stargazer.. (unknown [IPv6:240e:358:1182:dc00:dc73:854d:832e:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 6364966B06; Sat, 18 Nov 2023 12:50:02 -0500 (EST) From: Xi Ruoyao To: gcc-patches@gcc.gnu.org Cc: chenglulu , i@xen0n.name, xuchenghua@loongson.cn, Xi Ruoyao Subject: [PATCH] LoongArch: Fix "-mexplict-relocs=none -mcmodel=medium" producing %call36 when the assembler does not support it Date: Sun, 19 Nov 2023 01:45:55 +0800 Message-ID: <20231118174554.25661-2-xry111@xry111.site> X-Mailer: git-send-email 2.42.1 MIME-Version: 1.0 X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_STOCKGEN, LIKELY_SPAM_FROM, SPF_HELO_PASS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782925052647022049 X-GMAIL-MSGID: 1782925052647022049 Even if !HAVE_AS_SUPPORT_CALL36, const_call_insn_operand should still return false when -mexplict-relocs=none -mcmodel=medium to make loongarch_legitimize_call_address emit la.local or la.global. gcc/ChangeLog: * config/loongarch/predicates.md (const_call_insn_operand): Remove buggy "HAVE_AS_SUPPORT_CALL36" conditions. Change "1" to "true" to make the coding style consistent. --- Not fully regtested, but it should be obvious and it indeed fixes the func-call-medium-*.c test failures. Ok for trunk? gcc/config/loongarch/predicates.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gcc/config/loongarch/predicates.md b/gcc/config/loongarch/predicates.md index 56f7c48e126..d02e846cb12 100644 --- a/gcc/config/loongarch/predicates.md +++ b/gcc/config/loongarch/predicates.md @@ -444,21 +444,19 @@ (define_predicate "const_call_insn_operand" case SYMBOL_PCREL: if (TARGET_CMODEL_EXTREME || (TARGET_CMODEL_MEDIUM - && HAVE_AS_SUPPORT_CALL36 && (la_opt_explicit_relocs == EXPLICIT_RELOCS_NONE))) return false; else - return 1; + return true; case SYMBOL_GOT_DISP: if (TARGET_CMODEL_EXTREME || !flag_plt || (flag_plt && TARGET_CMODEL_MEDIUM - && HAVE_AS_SUPPORT_CALL36 && (la_opt_explicit_relocs == EXPLICIT_RELOCS_NONE))) return false; else - return 1; + return true; default: return false;