From patchwork Tue Nov 13 03:23:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 996769 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-489814-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="I+veuBkl"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XhWQAzti"; 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 42vCdM6909z9s9G for ; Tue, 13 Nov 2018 14:23:35 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=PDj8na5QpvWIVYgwZ47mXHvvDC6CtvQcrwsSV+MfafMI7sEMmM yl0DA8p4rygGvcLJSVfYWmm64PcNnt4Tic4AE9dXS6Og1ouQlqzMH85zNjOYYkOK ryqWfLPXsLFBmPxCPKMKPQnprwxKs5ymyTgoPtrxu89LiYo+FxvKD3mOA= 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:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=3iyKKP9QS6X+ekLBskQx9HB/gDc=; b=I+veuBklEnOg/TgkUZXb wPhA8YzU3AEuQZJDJd3FGTvyLpyKCJEpFe/7BXRg60fzEURChltO5+E8SSXCLzmw 1gLSPj+uWVxxLa/8Vbvp5qSpY0zxY55y4GEXusgLiQv4iGOj7Ry+HVSpr1BpBcgQ h0LGWTktnp7jamRYvkvUxTM= Received: (qmail 15521 invoked by alias); 13 Nov 2018 03:23:27 -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 15503 invoked by uid 89); 13 Nov 2018 03:23:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=SYMBOL_REF, 5936, Hx-languages-length:1630, HX-HELO:sk:mail-pf X-HELO: mail-pf1-f181.google.com Received: from mail-pf1-f181.google.com (HELO mail-pf1-f181.google.com) (209.85.210.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 Nov 2018 03:23:26 +0000 Received: by mail-pf1-f181.google.com with SMTP id c72so622900pfc.6 for ; Mon, 12 Nov 2018 19:23:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=4EvWcZ+Of0uCi0p2JAjXDVkPvbjQxKwwUOxBQjsmxq4=; b=XhWQAztiBZoxsRWXSlIsea3X9vmz1dh6U1Epyklpp6ajutuPViVPFi9OkPT1k6MBaW CbshTJBj+hpubNJEAdWYlJIbyiR/DYyBzLjEcRrU3lDOkAt3AZub6+NIc0M0FPHYxAKs 1EXpo5BvrXBk12IjI28xYKm7LkjoZg32JsXTQOVJdGUFsrx0JwDhnqmCc48dRznSErxb H9pYYMZryZmAPVY1T0WW7RP5hrO7IIQ3tZhpAahLBfGs0N8xOFqFjZNN97S33t165LtG sE7yKqp46TZYizazY9AAz0UMY+DFLs/2oQ69M70tUnBTmGsxXCTaH18Mphke1fwktLly XkZg== Received: from bubble.grove.modra.org ([58.175.241.133]) by smtp.gmail.com with ESMTPSA id g14-v6sm701108pfg.98.2018.11.12.19.23.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Nov 2018 19:23:23 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 4857F804D6; Tue, 13 Nov 2018 13:53:20 +1030 (ACDT) Date: Tue, 13 Nov 2018 13:53:20 +1030 From: Alan Modra To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [RS6000] Don't put large integer constants in TOC for -mcmodel=medium Message-ID: <20181113032320.GL29784@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-IsSubscribed: yes For -mcmodel=medium we can use toc-relative addressing to access constants placed in read-only data, which is better since they can be merged when in .rodata.cst8. Bootstrapped etc. powerpc64le-linux. OK? * config/rs6000/linux64.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Exclude integer constants when -mcmodel=medium. diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h index e6b4fd22d73..0d8e164a598 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -582,8 +582,10 @@ extern int dot_symbols; we also do this for floating-point constants. We actually can only do this if the FP formats of the target and host machines are the same, but we can't check that since not every file that uses - the macros includes real.h. We also do this when we can write the - entry into the TOC and the entry is not larger than a TOC entry. */ + the macros includes real.h. We also do this when we can write an + integer into the TOC and the entry is not larger than a TOC entry, + but not for -mcmodel=medium where we'll use a toc-relative load for + constants outside the TOC. */ #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \ @@ -593,6 +595,7 @@ extern int dot_symbols; && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \ || GET_CODE (X) == LABEL_REF \ || (GET_CODE (X) == CONST_INT \ + && TARGET_CMODEL != CMODEL_MEDIUM \ && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \ || (GET_CODE (X) == CONST_DOUBLE \ && ((TARGET_64BIT \