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 E3E713857C7B for ; Mon, 20 Dec 2021 12:34:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E3E713857C7B 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 C5470661DD; Mon, 20 Dec 2021 07:34:05 -0500 (EST) Message-ID: Subject: Re: [PATCH v3 03/12] LoongArch Port: Machine Decsription files. From: Xi Ruoyao To: Chenghua Xu , gcc-patches@gcc.gnu.org Cc: yangyujie@loongson.cn, chenglulu@loongson.cn Date: Mon, 20 Dec 2021 20:34:02 +0800 In-Reply-To: <20211210074359.988056-4-xuchenghua@loongson.cn> References: <20211210074359.988056-1-xuchenghua@loongson.cn> <20211210074359.988056-4-xuchenghua@loongson.cn> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.2 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 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: Mon, 20 Dec 2021 12:34:11 -0000 On Fri, 2021-12-10 at 15:43 +0800, Chenghua Xu wrote: > + > +INT_MODE (OI, 32); > + > +/* Keep the OI modes from confusing the compiler into thinking > +   that these modes could actually be used for computation.  They are > +   only holders for vectors during data movement.  */ > +#define MAX_BITSIZE_MODE_ANY_INT (128) This can't prevent the compiler from using OImode for calculation. And to make things even worse, in wide-int.h we have: > #define WIDE_INT_MAX_ELTS \ > ((MAX_BITSIZE_MODE_ANY_INT + HOST_BITS_PER_WIDE_INT) / HOST_BITS_PER_WIDE_INT) /* ... */ > class GTY(()) wide_int_storage > { > private: > HOST_WIDE_INT val[WIDE_INT_MAX_ELTS]; When the compiler uses OImode, this array will eventually be accessed out-of-bound, causing ICE on fp-uint64-convert-double-{1,2}.c. All other ports don't define it (and let genmode to determine the value automatically). I drafted https://github.com/loongson/gcc/pull/64 to remove the MAX_BITSIZE_MODE_ANY_INT definition. Not sure if it's the "proper" fix though. -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University