From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mengyan1223.wang (mengyan1223.wang [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id C80DA3858D35 for ; Tue, 15 Mar 2022 14:35:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C80DA3858D35 Received: from localhost.localdomain (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@mengyan1223.wang) by mengyan1223.wang (Postfix) with ESMTPSA id BCA90662CF; Tue, 15 Mar 2022 10:35:26 -0400 (EDT) Message-ID: <5dd635efebd36cc16f0141ae7e7ef2ceebc0955c.camel@mengyan1223.wang> Subject: Re: [PATCH v8 00/12] Add LoongArch support. From: Xi Ruoyao To: xuchenghua@loongson.cn, gcc-patches@gcc.gnu.org Cc: chenglulu@loongson.cn, joseph@codesourcery.com, Huacai Chen Date: Tue, 15 Mar 2022 22:35:24 +0800 In-Reply-To: <20220304071809.3082015-1-xuchenghua@loongson.cn> References: <20220304071809.3082015-1-xuchenghua@loongson.cn> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3031.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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-List-Received-Date: Tue, 15 Mar 2022 14:35:31 -0000 On Fri, 2022-03-04 at 15:17 +0800, xuchenghua@loongson.cn wrote: > v7 -> v8 > 1. Add new addressing type ADDRESS_REG_REG support. > 2. Modify documentation. > 3. Eliminate compile-time warnings. Hi, The v8 series does not build LoongArch Linux kernel tree (https://github.com/loongson/linux, loongarch-next branch) successfully. This is a regression: the v7 series built the kernel fine. A testcase reduced from the __get_data_asm macro in uaccess.h: $ cat t1.c char *ptr; int offset; struct m { char a[2]; }; char x (void) { char t; asm volatile("ld.b %0, %1" : "=r"(t) : "o"(*(struct m *)(ptr + offset))); return t; } $ ./gcc/cc1 t1.c -nostdinc -O t1.c: In function ‘x’: t1.c:12:3: error: impossible constraint in ‘asm’ 12 | asm volatile("ld.b %0, %1" : "=r"(t) : "o"(*(struct m *)(ptr + offset))); | ^~~ It seems changing the constraint "o" to "m" can work around this issue. I'm not sure if this is a compiler bug or a kernel bug. -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University