From patchwork Thu Sep 7 15:53:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 811080 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-461690-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="AethnKjS"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xp4kP0vrKz9t2v for ; Fri, 8 Sep 2017 01:53:48 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=DK2aNt8ETcP3/gpX bVklmTvG9ztU+/UH4h94Qhu8b5EUm7LXJdj8G4BkWa3gEvJJc7puoO+SgBASEsK4 v/hSNMG/zU/EBd42xwqdNE/FIuJo5wMxDuow3J72Ht5SW8lHuBsCL6qLfxowjizl 3cwAWvyiBjQHCgHZRQgZeV75qxc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=EwiaITT3qoAoKha8xs4hjt cBN1E=; b=AethnKjSEGdbgw62sdNAPntIW3XrB7CubuELAhJ6nsGZahAmqnyTg6 GpQnhOepEk1Vm7XA3Cup6HCjzEpbLfhpw2mHjs+Zn8QnzxMdsLPfrFNJYp0E45+P 93hbt3+fRhJIOEu79LO+I19PCNiY8WFSbCWa4VCQEoXAHwZUs4heY= Received: (qmail 36324 invoked by alias); 7 Sep 2017 15:53:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 36293 invoked by uid 89); 7 Sep 2017 15:53:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=plausible X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Sep 2017 15:53:30 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 17DD682284 for ; Thu, 7 Sep 2017 17:53:29 +0200 (CEST) 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 XvFG-cUoe0_v for ; Thu, 7 Sep 2017 17:53:29 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (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 E886282273 for ; Thu, 7 Sep 2017 17:53:28 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [SPARC] Fix PR target/80897 Date: Thu, 07 Sep 2017 17:53:28 +0200 Message-ID: <3663443.W5a8jlDd2i@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-53-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 This is the Ada bootstrap failure on SPARC64/Linux that I worked around at some point; it turns out that we can do something plausible in the back-end. Tested on SPARC64/Linux, applied on mainline. 2017-09-07 Eric Botcazou PR target/80897 * config/sparc/sparc.c (sparc_emit_set_symbolic_const64): Deal with too large offsets. 2017-09-07 Eric Botcazou * gnat.dg/opt67.adb: New test. * gnat.dg/opt67_pkg.ad[sb]: New helper. Index: config/sparc/sparc.c =================================================================== --- config/sparc/sparc.c (revision 251811) +++ config/sparc/sparc.c (working copy) @@ -2159,9 +2159,25 @@ sparc_emit_set_const32 (rtx op0, rtx op1 void sparc_emit_set_symbolic_const64 (rtx op0, rtx op1, rtx temp) { - rtx temp1, temp2, temp3, temp4, temp5; + rtx cst, temp1, temp2, temp3, temp4, temp5; rtx ti_temp = 0; + /* Deal with too large offsets. */ + if (GET_CODE (op1) == CONST + && GET_CODE (XEXP (op1, 0)) == PLUS + && CONST_INT_P (cst = XEXP (XEXP (op1, 0), 1)) + && trunc_int_for_mode (INTVAL (cst), SImode) != INTVAL (cst)) + { + gcc_assert (!temp); + temp1 = gen_reg_rtx (DImode); + temp2 = gen_reg_rtx (DImode); + sparc_emit_set_const64 (temp2, cst); + sparc_emit_set_symbolic_const64 (temp1, XEXP (XEXP (op1, 0), 0), + NULL_RTX); + emit_insn (gen_rtx_SET (op0, gen_rtx_PLUS (DImode, temp1, temp2))); + return; + } + if (temp && GET_MODE (temp) == TImode) { ti_temp = temp;