From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id A37D63858C66 for ; Tue, 26 Sep 2023 18:59:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A37D63858C66 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 798501FB; Tue, 26 Sep 2023 12:00:27 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5ECAD3F5A1; Tue, 26 Sep 2023 11:59:43 -0700 (PDT) From: Richard Sandiford To: =?utf-8?B?6ZKf5bGF5ZOy?= Mail-Followup-To: =?utf-8?B?6ZKf5bGF5ZOy?= ,gcc-patches , kito.cheng , kito.cheng , "Jeff Law" , rdapp.gcc , richard.sandiford@arm.com Cc: gcc-patches , kito.cheng , kito.cheng , "Jeff Law" , rdapp.gcc Subject: Re: [PATCH] RISC-V: Add opaque integer modes to fix ICE on DSE[PR111590] References: <20230926024507.3076723-1-juzhe.zhong@rivai.ai> Date: Tue, 26 Sep 2023 19:59:42 +0100 In-Reply-To: (=?utf-8?B?IumSn+WxheWTsiIncw==?= message of "Tue, 26 Sep 2023 23:01:56 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-23.2 required=5.0 tests=BAYES_00,BODY_8BITS,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,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: =E9=92=9F=E5=B1=85=E5=93=B2 writes: > Thanks Richard. > > Is it correct as follows ? > > diff --git a/gcc/dse.cc b/gcc/dse.cc > index 8b07be17674..c58d3bf4e1b 100644 > --- a/gcc/dse.cc > +++ b/gcc/dse.cc > @@ -1733,7 +1733,7 @@ find_shift_sequence (poly_int64 access_size, > /* If a constant was stored into memory, try to simplify it here, > otherwise the cost of the shift might preclude this optimization > e.g. at -Os, even when no actual shift will be needed. */ > - if (store_info->const_rhs) > + if (store_info->const_rhs && known_le (access_size, GET_MODE_SIZE (MAX= _MODE_INT))) Yes, but the "&& ..." needs to be on a new line because of the 80-character limit. > I failed to find native_encode_rtx and native_decode_rtx. See simplify-rtx.cc. Richard