From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id 5C5723858D28 for ; Wed, 6 Sep 2023 01:59:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C5723858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=irq.a4lg.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=irq.a4lg.com Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 91270300089; Wed, 6 Sep 2023 01:59:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1693965543; bh=KC3RGC2PC5XZ0hcbV92Oxe6aLxO7sfFgJXEJi0QxdtY=; h=Message-ID:Date:Mime-Version:Subject:To:References:Cc:From: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=guY6KYk0XcckQD3ynYVk33ac+IljNJ5hYLjtJnx7rDYhX0KblOoqOcHtJ+C+d4lg+ vsdUImiD9VNt4mI5VT5J/lyVzQgwSavogx1ghQ5g6VffPTlP780j/K53HjCySu1TJn ejYnWJH7pJL5ctM5kFtspsYkOPLQ/Ux7acvxfp2k= Message-ID: Date: Wed, 6 Sep 2023 10:59:02 +0900 Mime-Version: 1.0 Subject: Re: [PATCH v2] RISC-V: Fix Zicond ICE on large constants To: Jeff Law References: <3cc5403de383d7c8cfd1769948c2bcf9d54b97f9.1693786829.git.research_trasio@irq.a4lg.com> <37a03341f16da30b83bec1f4ef51dce4e6f25264.1693915537.git.research_trasio@irq.a4lg.com> <9f61bea2-88a9-44fc-be29-bf59c93d9b76@gmail.com> Content-Language: en-US Cc: GCC Patches From: Tsukasa OI In-Reply-To: <9f61bea2-88a9-44fc-be29-bf59c93d9b76@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KAM_SHORT,SPF_HELO_NONE,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 List-Id: On 2023/09/06 10:22, Jeff Law wrote: > > > On 9/5/23 06:08, Tsukasa OI wrote: >> From: Tsukasa OI >> >> Large constant cons and/or alt will trigger ICEs building GCC target >> libraries (libgomp and libatomic) when the 'Zicond' extension is enabled. >> >> For instance, zicond-ice-2.c (new test case in this commit) will cause >> an ICE when SOME_NUMBER is 0x1000 or larger.  While opposite numbers >> corresponding cons/alt (two temp2 variables) are checked, cons/alt >> themselves are not checked and causing 2 ICEs building >> GCC target libraries as of this writing: >> >> 1.  gcc/libatomic/config/posix/lock.c >> 2.  gcc/libgomp/fortran.c >> >> Coercing a large value into a register will fix the issue. >> >> It also coerce a large cons into a register on "imm, imm" case (the >> author >> could not reproduce but possible to cause an ICE). >> >> gcc/ChangeLog: >> >>     * config/riscv/riscv.cc (riscv_expand_conditional_move): Force >>     large constant cons/alt into a register. >> >> gcc/testsuite/ChangeLog: >> >>     * gcc.target/riscv/zicond-ice-2.c: New test.  This is based on >>     an ICE at libat_lock_n func on gcc/libatomic/config/posix/lock.c >>     but heavily minimized. > "New test." is sufficient.  No need to change it, just a note going > forward. > > OK.  Thanks for taking care of this. > > jeff > Thanks for reviewing. I'll remember that for the next time (I am adding brief description in Binutils but not *that* long compared to this). Committing. Tsukasa