From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.eu.adacore.com (mel.act-europe.fr [194.98.77.210]) by sourceware.org (Postfix) with ESMTPS id 9D5EB393742C for ; Fri, 13 Mar 2020 10:44:13 +0000 (GMT) Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 572108137C; Fri, 13 Mar 2020 11:44:12 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at eu.adacore.com Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UV_GKYOhzIru; Fri, 13 Mar 2020 11:44:12 +0100 (CET) Received: from polaris.localnet (unknown [IPv6:2a01:e0a:41b:9230:1a03:73ff:fe45:373a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 3A86981368; Fri, 13 Mar 2020 11:44:12 +0100 (CET) From: Eric Botcazou To: Richard Sandiford Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] lra: Tighten check for reloading paradoxical subregs [PR94052] Date: Fri, 13 Mar 2020 11:44:10 +0100 Message-ID: <3276106.PqY0JBGKGl@polaris> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Fri, 13 Mar 2020 10:44:14 -0000 > I think there are two problems with this: > > (1) It never actually checks whether the hard register is valid for the > outer mode (in the hard_regno_mode_ok sense). If it isn't, any attempt > to reload in the outer mode is likely to cycle, because the implied > regno/mode combination will be just as invalid next time > curr_insn_transform sees the subreg. > > (2) The check is valid for little-endian only. For big-endian we need > to move hard_regno backwards. > > Using simplify_subreg_regno should avoid both problems. We have apparently a cycle in LRA on the SPARC, see PR rtl-opt/92303. -- Eric Botcazou