Message ID | d4c6022ba84c2c95af5bf231ae6a7fdfd0aef2da.camel@xry111.site |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:ecc5:0:0:0:0:0 with SMTP id s5csp1437552wro; Wed, 24 Aug 2022 07:04:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR7oGFJrXg7J+4IgT6GwlXfSc23Vz2/RYIG1wAAHU60QBPOwuNd7WjoCqUZXbiCzh/1qt5b4 X-Received: by 2002:a17:906:4796:b0:734:b5b5:96ed with SMTP id cw22-20020a170906479600b00734b5b596edmr2997011ejc.251.1661349890128; Wed, 24 Aug 2022 07:04:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661349890; cv=none; d=google.com; s=arc-20160816; b=TMIMyUNG4m2Dp5oIvROrCqFxTDDe4IVkDSOl8DIRRszQ3ylNCNJwCBqRAZ3Ws3iwAP CaF1UsaqvlgXDoAiAwJJGhXKo4sTM8+fdRXqkrIo0TPFclZGWHkZoNqKG2V14zjk3Y4N KDUzJ6q8U+5FyYXoMVF9YF56I+ZLSKjl+pFlnhsPio27SWnlz4hsqSXjkEtuq8detyQY GRw15P3skDgjqcdzTTiA3mlAHFWlVx9Q1GiNFQYt+36Ihj3Bl7cAHn2t2SrqFG/lPt7x U09bhYTpwwv6oOVPLP2NkiE0DMKEKsrXpPxmJVa1WTXG0Tzds9DrQ2HvCfqZDgT7NZC8 i3Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:user-agent:content-transfer-encoding:date:to:subject :message-id:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=n3RTOCSJIvxq20fXEPJDEVomD23GXzaEbgUydC9MNxo=; b=imsbRSSVh92iq24QhAyyf2v5u7QGEyn8UqdP5NuYdyD4cDpnSjpjM+qNAtwhTIz8Dj fl8/eripq9q5hK7PF/4mb1mAEJRidxEf+Q7cTIgyIO2Xk2OSdIWSYWZ6B4R+VcKuUVd4 1ZaffpxTKN/cAe/E2rfEvorx5d9FVBpuwOgQUNpaS4xesyj8qPiW+TyRfXA0BjpL0Il3 relvv59mbfOimWWu/1BLNoM4CbqwPfOstKr5apoRX3AvFQ7V8w0h6Q5/Oa0Yl3Nu+cKe 8jkMeP3QxsZmnA5/BuS6WLUwDGvdWoJ49A5av6miF//0zfJNo+ek7j8386HhtiPwESXp eXRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="H2Uj8/gM"; 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 b4-20020a17090636c400b00734be0ce0e5si1895736ejc.311.2022.08.24.07.04.49 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 07:04:50 -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="H2Uj8/gM"; 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 BB86638515ED for <ouuuleilei@gmail.com>; Wed, 24 Aug 2022 14:04:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB86638515ED DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661349866; bh=n3RTOCSJIvxq20fXEPJDEVomD23GXzaEbgUydC9MNxo=; h=Subject:To:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=H2Uj8/gMoQhy5BQrAENWg1Q6JX2+QFZXIyTtID9UdL+SEBEYQmbtcexPChB26ez9M Y2a3oexn8A0mQcAjZhLnlSH3A5AmrNSInuSx385/R/2yDZzUghuxrlqcwZp3u4BT8l Z96+cgDfZaqsCwBFLGV5VEUjMk6z/SATu8TlS4uU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by sourceware.org (Postfix) with ESMTPS id A2DB4385C32C for <gcc-patches@gcc.gnu.org>; Wed, 24 Aug 2022 14:03:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A2DB4385C32C Received: from [IPv6:240e:358:113a:9c00:dc73:854d:832e:3] (unknown [IPv6:240e:358:113a:9c00:dc73:854d:832e:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384)) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 5FF4C6699F; Wed, 24 Aug 2022 10:03:31 -0400 (EDT) Message-ID: <d4c6022ba84c2c95af5bf231ae6a7fdfd0aef2da.camel@xry111.site> Subject: [PATCH 1/2] LoongArch: Avoid RTL flag check failure in loongarch_classify_symbol To: gcc-patches@gcc.gnu.org, Lulu Cheng <chenglulu@loongson.cn> Date: Wed, 24 Aug 2022 22:03:26 +0800 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.45.2 MIME-Version: 1.0 X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, FROM_SUSPICIOUS_NTLD_FP, GIT_PATCH_0, KAM_STOCKGEN, LIKELY_SPAM_FROM, PDS_OTHER_BAD_TLD, 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.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Xi Ruoyao via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Xi Ruoyao <xry111@xry111.site> Cc: Jinyang He <hejinyang@loongson.cn>, Chenghua Xu <xuchenghua@loongson.cn>, Huacai Chen <chenhuacai@kernel.org>, Youling Tang <tangyouling@loongson.cn>, Wang Xuerui <i@xen0n.name> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1742051622412013813?= X-GMAIL-MSGID: =?utf-8?q?1742051622412013813?= |
Series |
[1/2] LoongArch: Avoid RTL flag check failure in loongarch_classify_symbol
|
|
Commit Message
Xi Ruoyao
Aug. 24, 2022, 2:03 p.m. UTC
SYMBOL_REF_TLS_MODEL invokes SYMBOL_REF_FLAGS, and SYMBOL_REF_FLAGS invokes RTL_FLAG_CHECK1 and aborts when RTL code is not SYMBOL_REF. r13-1833 removed "gcc_assert (SYMBOL_REF_P (x))" before invoking "SYMBOL_REF_TLS_MODEL (x)", indicating that it's now possible that "x" is not a SYMBOL_REF. So we need to check if "x" is SYMBOL_REF first. This fixes a test failure happening with r13-2173: pr106096.C:26:1: internal compiler error: RTL flag check: SYMBOL_REF_FLAGS used with unexpected rtx code 'const' in loongarch_classify_symbol gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_classify_symbol): Return early if the rtx is not SYMBOL_REF. --- gcc/config/loongarch/loongarch.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Comments
在 2022/8/24 下午10:03, Xi Ruoyao 写道: > SYMBOL_REF_TLS_MODEL invokes SYMBOL_REF_FLAGS, and SYMBOL_REF_FLAGS > invokes RTL_FLAG_CHECK1 and aborts when RTL code is not SYMBOL_REF. > > r13-1833 removed "gcc_assert (SYMBOL_REF_P (x))" before invoking > "SYMBOL_REF_TLS_MODEL (x)", indicating that it's now possible that "x" > is not a SYMBOL_REF. So we need to check if "x" is SYMBOL_REF first. > > This fixes a test failure happening with r13-2173: > > pr106096.C:26:1: internal compiler error: RTL flag check: > SYMBOL_REF_FLAGS used with unexpected rtx code 'const' in > loongarch_classify_symbol I think there is no problem with the code modification, but I have not detected this ICE.
On Thu, 2022-08-25 at 16:29 +0800, Lulu Cheng wrote: > > 在 2022/8/24 下午10:03, Xi Ruoyao 写道: > > > SYMBOL_REF_TLS_MODEL invokes SYMBOL_REF_FLAGS, and SYMBOL_REF_FLAGS > > invokes RTL_FLAG_CHECK1 and aborts when RTL code is not SYMBOL_REF. > > > > r13-1833 removed "gcc_assert (SYMBOL_REF_P (x))" before invoking > > "SYMBOL_REF_TLS_MODEL (x)", indicating that it's now possible that > > "x" > > is not a SYMBOL_REF. So we need to check if "x" is SYMBOL_REF > > first. > > > > This fixes a test failure happening with r13-2173: > > > > pr106096.C:26:1: internal compiler error: RTL flag check: > > SYMBOL_REF_FLAGS used with unexpected rtx code 'const' in > > loongarch_classify_symbol > > I think there is no problem with the code modification, but I have not > detected this ICE. If ENABLE_RTL_CHECKING is disabled (for example, use --enable- checking=release, which is also the default for release tarballs), the check will be skipped.
diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc index 16fd4acc970..41d9cca6d31 100644 --- a/gcc/config/loongarch/loongarch.cc +++ b/gcc/config/loongarch/loongarch.cc @@ -1633,14 +1633,13 @@ loongarch_rtx_constant_in_small_data_p (machine_mode mode) static enum loongarch_symbol_type loongarch_classify_symbol (const_rtx x) { - if (LABEL_REF_P (x)) + if (!SYMBOL_REF_P (x)) return SYMBOL_PCREL; if (SYMBOL_REF_TLS_MODEL (x)) return SYMBOL_TLS; - if (SYMBOL_REF_P (x) - && !loongarch_symbol_binds_local_p (x)) + if (!loongarch_symbol_binds_local_p (x)) return SYMBOL_GOT_DISP; return SYMBOL_PCREL;