From patchwork Mon Nov 7 09:44:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 81018 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp923312qge; Mon, 7 Nov 2016 01:45:39 -0800 (PST) X-Received: by 10.99.151.17 with SMTP id n17mr9525845pge.150.1478511939232; Mon, 07 Nov 2016 01:45:39 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id f4si30226982pfc.185.2016.11.07.01.45.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 01:45:39 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-440582-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-440582-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-440582-patch=linaro.org@gcc.gnu.org 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:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=IUx h96178PFAIMiuhIDq83oeUJps9aaJwulcOGV6rOPokpyqi8FY2ewWYS06oRdFYyt iJDeWephyydXuPY4mc+tKQwMN8yVHd3IxXwxtnX0VAbLyVeOgvvjpSaN0rQwv02f t9AhA6K2K4RNlrxj3bQW9+PZYL1EdAOGI9wPcgSU= 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:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=UvMU3ejj6 12pn/9CXB1bjiOI1DM=; b=XcV/IMAqXxCWxK/V8wcZLndSBUL5BLLjRQm6wlVCR 2iEUWwHUzKt6vWxyP9T2OwO3RQu5rO0bAU9nEsSRL6x57ud1fFJNCdOamE3psYvI ngVMnzFusdZXatYdsZwaGhNEkv1fvLEN1xS48/q18YunAAvDNvQNXJ4COJH96Epf Sw= Received: (qmail 123381 invoked by alias); 7 Nov 2016 09:45:04 -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 123337 invoked by uid 89); 7 Nov 2016 09:45:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=formally 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; Mon, 07 Nov 2016 09:45:01 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 5E7EC812E8 for ; Mon, 7 Nov 2016 10:44:59 +0100 (CET) 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 Ry7NJeW9nJUM for ; Mon, 7 Nov 2016 10:44:59 +0100 (CET) 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 39CF8812E6 for ; Mon, 7 Nov 2016 10:44:59 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Re: [rs6000] Fix reload failures in 64-bit mode with no special constant pool Date: Mon, 07 Nov 2016 10:44:44 +0100 Message-ID: <4833987.MWR9OqUvYI@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-48-desktop; KDE/4.14.9; x86_64; ; ) In-Reply-To: <11068946.f4xvach6CP@polaris> References: <11068946.f4xvach6CP@polaris> MIME-Version: 1.0 > Now you don't need to have a special pool to call create_TOC_reference, you > can call it for regular TOC references as well, as done a few lines above: > > /* If this is a SYMBOL_REF that refers to a constant pool entry, > and we have put it in the TOC, we just need to make a TOC-relative > reference to it. */ > if (TARGET_TOC > && GET_CODE (operands[1]) == SYMBOL_REF > && use_toc_relative_ref (operands[1], mode)) > operands[1] = create_TOC_reference (operands[1], operands[0]); > > So the attached patch does it there too. > > Tested on PowerPC64/Linux (LRA) and VxWorks (reload), OK for the mainline? Revised version attached, with Pmode formally changed to mode (but mode == Pmode here so no functional change whatsoever). Tested on PowerPC64/Linux, OK for the mainline? * config/rs6000/rs6000.c (rs6000_emit_move): Also use a TOC reference after forcing to constant memory when the code model is medium. -- Eric Botcazou Index: config/rs6000/rs6000.c =================================================================== --- config/rs6000/rs6000.c (revision 241856) +++ config/rs6000/rs6000.c (working copy) @@ -10673,10 +10673,7 @@ rs6000_emit_move (rtx dest, rtx source, if (TARGET_TOC && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF - && constant_pool_expr_p (XEXP (operands[1], 0)) - && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P ( - get_pool_constant (XEXP (operands[1], 0)), - get_pool_mode (XEXP (operands[1], 0)))) + && use_toc_relative_ref (XEXP (operands[1], 0), mode)) { rtx tocref = create_TOC_reference (XEXP (operands[1], 0), operands[0]);