From patchwork Thu Dec 1 15:29:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Greenhalgh X-Patchwork-Id: 86075 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp745365qgi; Thu, 1 Dec 2016 07:30:21 -0800 (PST) X-Received: by 10.84.143.162 with SMTP id 31mr21122632plz.2.1480606221310; Thu, 01 Dec 2016 07:30:21 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id q77si569948pfj.115.2016.12.01.07.30.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Dec 2016 07:30:21 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-443225-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-443225-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-443225-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:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=MxZWxjeC9vA3qpTJ AU65vH8R3F+woWDINlgrM62PyASDgALr9xGJjCGZ1qAT/WwzoGym5xCtq7mBnrUH mkUzyTfysiEArArJsjNwGmDbf98+8Vl64wiIKZzQNdo7uBJS4+hq8myGMaOTNxuP xM/8ObRacl644KdmoSDmMX/Ybms= 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:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=bh38JCo2/mK5WDnAuWIU/+ isPPk=; b=pxBzztWAGIISMzmucekNsJSwS4O9aKdp6K/eJJXx1x6IT4qT7FpubG o1g2hVxmpkOMXM3F+IHRSKt4w+mJ2Jeh8GwcEGMAdVMZmyjv+1s9Va0KZbnc8Mn1 7m/ZfYajylWKhOoZ3zg/x7489ed4pBVzE2pl9xpxZSWlPar9bBKcU= Received: (qmail 83701 invoked by alias); 1 Dec 2016 15:29:54 -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 83596 invoked by uid 89); 1 Dec 2016 15:29:54 -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_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2849 X-HELO: EUR01-DB5-obe.outbound.protection.outlook.com Received: from mail-db5eur01on0073.outbound.protection.outlook.com (HELO EUR01-DB5-obe.outbound.protection.outlook.com) (104.47.2.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 01 Dec 2016 15:29:43 +0000 Received: from HE1PR0801CA0042.eurprd08.prod.outlook.com (10.167.184.52) by AM2PR08MB0435.eurprd08.prod.outlook.com (10.163.148.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.747.13; Thu, 1 Dec 2016 15:29:35 +0000 Received: from AM1FFO11FD006.protection.gbl (2a01:111:f400:7e00::102) by HE1PR0801CA0042.outlook.office365.com (2603:10a6:3:6::52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9 via Frontend Transport; Thu, 1 Dec 2016 15:29:35 +0000 Authentication-Results: spf=pass (sender IP is 217.140.96.140) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=none (message not signed) header.d=none; gcc.gnu.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 217.140.96.140 as permitted sender) receiver=protection.outlook.com; client-ip=217.140.96.140; helo=nebula.arm.com; Received: from nebula.arm.com (217.140.96.140) by AM1FFO11FD006.mail.protection.outlook.com (10.174.64.68) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.734.4 via Frontend Transport; Thu, 1 Dec 2016 15:29:35 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:781; Count:13 Received: from e107456-lin.cambridge.arm.com (10.1.2.79) by mail.arm.com (10.1.106.66) with Microsoft SMTP Server id 14.3.294.0; Thu, 1 Dec 2016 15:29:24 +0000 From: James Greenhalgh To: CC: Subject: [Patch 2/2 PR78561] Recalculate constant pool size before emitting it Date: Thu, 1 Dec 2016 15:29:17 +0000 Message-ID: <1480606157-29525-3-git-send-email-james.greenhalgh@arm.com> In-Reply-To: <1480606157-29525-1-git-send-email-james.greenhalgh@arm.com> References: <1480606157-29525-1-git-send-email-james.greenhalgh@arm.com> MIME-Version: 1.0 X-IncomingHeaderCount: 13 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:217.140.96.140; IPV:CAL; SCL:-1; CTRY:GB; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(377424004)(189002)(199003)(246002)(86362001)(305945005)(2476003)(4610100001)(4326007)(5000100001)(76176999)(6916009)(2950100002)(50986999)(5890100001)(6666003)(92566002)(5660300001)(110136003)(36756003)(189998001)(50226002)(8936002)(8676002)(356003)(39410400001)(26826002)(568964002)(38730400001)(7846002)(84326002)(512874002)(39450400002)(626004)(77096006)(104016004)(106466001)(2906002)(33646002)(450100001)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR08MB0435; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD006; 1:MjqJ9Gchvk4sU1sK4Is/VbONKqV3Y98eQKQeDjHHjRUi/F26MgGj8tTWQhVFNtkCoALqbbDooilQpmRGhCXlueafQ51EXOabePsUik1VhKLpGoECkJWlGhopFpgPDhU2hHCDXFzZWy3mZmOKZRI0RmIHBgprWvC0ZR7MHPEfVsRTMX1fmBf6BjbtLRNvgmK0ys8pQJstpOAFi0cmLuSAG8aXthSF5qUXvAT2d2O1/hIzzcIcQnElgiYdK+Vzg33TEuQ++XMpDZAtVrWHJzaGltje15YAXPjdPGlXSHxkmzxZuL7OPzgwxJqlHKeyTS8BqO9E/Rm2NTdUMRp575FmuK5s+1dkUoyQdT7bRPBNRRDkaBHAzjVpQbMz4cI0WaVk4P/4wpsDmbG0ksY0X2YJqLaFtMQ9DCOXEynJHVnZ55sEsKCTIXVJlD3Olr35MtFRTvzopQtJr0NxlxDVyLjunpQru+C7odH9jwv5AeKiS728FSSl61Q18j8pSNgwErzKl008IMeb65hD8ve3WHvMRnbhpur2Su5KnOiviJ/sQC0fJmhQTj7WAWOc3olQ+LPJjqm6LxjbN4AGppm6tJAg8w== X-MS-Office365-Filtering-Correlation-Id: a83a9cf2-8def-4998-0909-08d419fedb09 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:AM2PR08MB0435; X-Microsoft-Exchange-Diagnostics: 1; AM2PR08MB0435; 3:xuu76L1uLwCMw+ahq0dsBBq4KRo0oGJBwQPbDm45pgY2zruZ3Tzu4F7DDL9Lh2OvVyrR6IQeytDbTpANmQzwcpGJYIGqpYuaZbIJ3a9M4xNoe8LZ8Xd/D3OJfOUV7THV1vA+RxdjUhaVTMEWh5g2YrDV3L2Ai0qFDYP+P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b0Mianr4ROmjXJ3I6Mwv5+kjyLd55OSgPqe7UbGt5Xi/ZyFCIJ/0TL5rwtysoVLsgcGIjQgvjQfpbP90zeFC+xYF/Q=; 20:Q+GlGaPjDLqwpbKCWDgJPgkxd1DgWO3LaDH4KOxIb1GuYZF6QeabP3uSTreibI4B5K4CY6RYyhfjLYywF/x3Xeq1cQZl5NNuJWO6OLejbUPjr5+kqZLpfcPI1lQmwUXsopCWYD60jWFsoMu+vi+VW+WLoMUQ14XurkyLQYsnP9AmXAFBgDcXcQCWCKlAsf45yFiVnhObl4kdiJi92LAUs8XweUIYZBzLc/Hghrd9KMAYJFkgmovIUp0ki42U+VQJ NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415395)(6040375)(601004)(2401047)(13024025)(13013025)(8121501046)(13020025)(5005006)(13023025)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:AM2PR08MB0435; BCL:0; PCL:0; RULEID:; SRVR:AM2PR08MB0435; X-Microsoft-Exchange-Diagnostics: 1; AM2PR08MB0435; 4:a+JoUWTL8GbTGCIP4rGK1pHfdN1GQ9QLiI+0/ML4bQNQrsFulgR4Iyce3BffFmitsN++1jSyQr68myM5QYzVk7T+kHbDbssaUKXOpO93AjoBGnQ2Whc/VGNBvBlk1i+OXQYdfJauexUiiphwtTVq9CiJhaUrNxJIoFUJFtMcmAgBUfFpY7eVUbc3RgI7oQ6w62pkmNZTml9HD4hJzGdzay4pVxvRXDZzE6aulqRcp2j3ELY3ycIpLwwOSEV+6sDkJDw9QX3brkQS+Yfb38Lf+ltC4EO7HLX9OP5Xuy77bCpYW8nUCB1vOwdhOXeRheSKaG1P9aZp5kYr7d1Eh2VpRJFu75bKWVs/545UjOCAaEnQwn2rVB8jhn3TlsAZROii1YYqnfQ2MBDhWnQgO9CY5gT8VE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WQoXga8hv+/U3L68USe/0oXUoABMa8YZlNcy/PCUTSLCcuQDiAsRu2+/H49ZeXid6znV6nAsatYyfiC5SWuoH9xlSs11/oDfzCQpXljYWR2hwZv4ySHHPvE95we5wXABeWjy6EpfAGHH/SRHC+F/fkLgMsgOu1BUWSvPfN+APwdpnXI0lPq; 5:LY21PU2EPTOujtfvu1gVingC3YdBIusAll/obabt3gGBKC3hxyqa8mdtARya+eGcI2a7UXbVi34GF1SD3mppJ21N7tZqVqPruEGux4YgoZnvaDEAkbF8o8IMNL9PS94e+svbbsTtK1s7x46EyVIq6g==; 24:BIrXZgMW+QOOmxMDZ6DM/nmUyXf5EElQ6iHk0R1UNwQZz9sh9CMYlpNp6tjMsof0aUoCwS20DhYUTkD3MMGU5Ymy4UmRDTslF/uevLA38LQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM2PR08MB0435; 7:QIpg1lcnDqYIoqtfiUW6uCi+Kyi2t6n7WwiEZZ4NfN7fL9jSamKvaiXr4KAEZDXddiLu4+ue96j7sYggJPlc98MAQyd9DXYxji0GpGwEZzZ+JVnB4yEtTGrsTRSIhSeoe2lro2Y0zSz2A+LTNp80/BjJxU0lHq4zPa0nja89ruoEreDG+bEdC2xoaJo41P3xaSzthiMBAFkdl192efF+bLD+rG5q7V1ANoOfbE2IWVKsZIawELseHYQfmKDhJls9o08c2kBx9wSKyjmJ3UC0uXF/QgaxNcF4+I3a9jQAgpt4Y6tAFSZZ+yeOKrigQNg0qWOUCW97LIQrecNBvtidAFhAG+Xf4es9QEWF6giAOHHl0iPvzsRyDpc3ORynwuY1ArXADODW94XIecW6mGilOMs15aakhuHBZz9ePLOiLM0ARWttq123dP70V+jCHndkWGI0p4Ysl700U0IB3boK3g== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2016 15:29:35.0932 (UTC) X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[217.140.96.140]; Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR08MB0435 X-IsSubscribed: yes Hi, In PR78561, we try to make use of stale constant pool offset data when making decisions as to whether to output an alignment directive after the AArch64 constant pool. The offset data goes stale as we only ever increment it when adding new constants to the pool (it represents an upper bound on the size of the pool). To fix that, we should recompute the offset values shortly after sweeping through insns looking for valid constant. I'm not totally sure about this code so I'd appreciate comments on whether this is a sensible idea. Bootstrapped on aarch64-none-linux-gnu and x86-64-none-linux-gnu and checked with aarch64-none-elf with no issues. OK? Thanks, James gcc/ 2016-12-01 James Greenhalgh PR rtl-optimization/78561 * varasm.c (recompute_pool_offsets): New. (output_constant_pool): Call it. gcc/testsuite/ 2016-12-01 James Greenhalgh PR rtl-optimization/78561 * gcc.target/aarch64/pr78561.c: New. diff --git a/gcc/testsuite/gcc.target/aarch64/pr78561.c b/gcc/testsuite/gcc.target/aarch64/pr78561.c new file mode 100644 index 0000000..048d2d7 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr78561.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-Og -O3 -mcmodel=tiny" } */ + +int +main (__fp16 x) +{ + __fp16 a = 6.5504e4; + return (x <= a); +} diff --git a/gcc/varasm.c b/gcc/varasm.c index f8af0c1..f3cd70a 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -3942,6 +3942,29 @@ output_constant_pool_1 (struct constant_descriptor_rtx *desc, return; } +/* Recompute the offsets of entries in POOL, and the overall size of + POOL. Do this after calling mark_constant_pool to ensure that we + are computing the offset values for the pool which we will actually + emit. */ + +static void +recompute_pool_offsets (struct rtx_constant_pool *pool) +{ + struct constant_descriptor_rtx *desc; + pool->offset = 0; + + for (desc = pool->first; desc ; desc = desc->next) + if (desc->mark) + { + /* Recalculate offset. */ + unsigned int align = desc->align; + pool->offset += (align / BITS_PER_UNIT) - 1; + pool->offset &= ~ ((align / BITS_PER_UNIT) - 1); + desc->offset = pool->offset; + pool->offset += GET_MODE_SIZE (desc->mode); + } +} + /* Mark all constants that are referenced by SYMBOL_REFs in X. Emit referenced deferred strings. */ @@ -4060,6 +4083,11 @@ output_constant_pool (const char *fnname ATTRIBUTE_UNUSED, case we do not need to output the constant. */ mark_constant_pool (); + /* Having marked the constant pool entries we'll actually emit, we + now need to rebuild the offset information, which may have become + stale. */ + recompute_pool_offsets (pool); + #ifdef ASM_OUTPUT_POOL_PROLOGUE ASM_OUTPUT_POOL_PROLOGUE (asm_out_file, fnname, fndecl, pool->offset); #endif