From patchwork Thu Mar 14 18:38:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 1912206 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TwbkC0lNfz1yX0 for ; Fri, 15 Mar 2024 05:38:41 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4EFAD3857833 for ; Thu, 14 Mar 2024 18:38:39 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from dellerweb.de (dellerweb.de [173.249.48.176]) by sourceware.org (Postfix) with ESMTPS id 512F33858C60 for ; Thu, 14 Mar 2024 18:38:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 512F33858C60 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=parisc-linux.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=parisc-linux.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 512F33858C60 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=173.249.48.176 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710441500; cv=none; b=aaijGqyLupsqvXITiVHR2Hhamq//E1Q0b9Im6zwtpjqGd7eQa8PivAQVkKYefe15HX16uLgXVM8JuCJ7jRgAbwJI2dP9E/7hxe1gMHErYIxUwaTfomaUP2IezoVpxLy5MBoUfIJMlVgNGir4U+peEX/E2D8zIBgY8lgQEyJvBp0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710441500; c=relaxed/simple; bh=iE9dnz1NvdENDfgDKeMFGBIxee8/vCYs+Wn6cV0zNs8=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=IjX8bQX3P/gJfWzIv1P6/jfxcfmQD7XChT6B/KDM20blygIMvC0buYmqrub+2nU96xk87zRa1xT1N6KxrByPnty/deX7X7jiYf1HgzGS3AHXiiXVQcfemgjG42BVTg35EG5Q1PB00lXM87f0KJwTgfTzxTkrQvoE8IHsBm9L/mU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mx3210.localdomain (bras-base-otwaon0906w-grc-15-142-126-188-251.dsl.bell.ca [142.126.188.251]) by dellerweb.de (Postfix) with ESMTPSA id 25014160017D; Thu, 14 Mar 2024 19:38:17 +0100 (CET) Received: by mx3210.localdomain (Postfix, from userid 1000) id 736CE22011C; Thu, 14 Mar 2024 18:38:15 +0000 (UTC) Date: Thu, 14 Mar 2024 18:38:15 +0000 From: John David Anglin To: GCC Patches Subject: [committed] hppa: Fix REG+D address support before reload Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Tested on hppa-unknown-linux-gnu. Committed to trunk. Dave --- hppa: Fix REG+D address support before reload When generating PA 1.x code or code for GNU ld, floating-point accesses only support 5-bit displacements but integer accesses support 14-bit displacements. I mistakenly assumed reload could fix an invalid 14-bit displacement in a floating-point access but this is not the case. 2024-03-14 John David Anglin gcc/ChangeLog: PR target/114288 * config/pa/pa.cc (pa_legitimate_address_p): Don't allow 14-bit displacements before reload for modes that may use a floating-point load or store. diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc index 694123e37c9..129289f8e62 100644 --- a/gcc/config/pa/pa.cc +++ b/gcc/config/pa/pa.cc @@ -10968,20 +10968,15 @@ pa_legitimate_address_p (machine_mode mode, rtx x, bool strict, code_helper) /* Long 14-bit displacements always okay for these cases. */ if (INT14_OK_STRICT + || reload_completed || mode == QImode || mode == HImode) return true; - /* A secondary reload may be needed to adjust the displacement - of floating-point accesses when STRICT is nonzero. */ - if (strict) - return false; - - /* We get significantly better code if we allow long displacements - before reload for all accesses. Instructions must satisfy their - constraints after reload, so we must have an integer access. - Return true for both cases. */ - return true; + /* We have to limit displacements to those supported by + both floating-point and integer accesses as reload can't + fix invalid displacements. See PR114288. */ + return false; } if (!TARGET_DISABLE_INDEXING