From patchwork Mon Dec 19 17:58:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Greenhalgh X-Patchwork-Id: 88507 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1295919qgi; Mon, 19 Dec 2016 09:58:40 -0800 (PST) X-Received: by 10.99.123.87 with SMTP id k23mr31055970pgn.101.1482170320612; Mon, 19 Dec 2016 09:58:40 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id r62si19159853pgr.192.2016.12.19.09.58.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Dec 2016 09:58:40 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-444777-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-444777-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-444777-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=pO0H1OaT7tk6p0F/ MSthTIpqMxGwdQ8ySNx+X0TZZP3oUl89K278WWKdqRvhrLYSvkl+FhDeplrIkEE9 3A6qKiq8BbSbtMWduZFvi5mcd6RJWTKc4isZOaI8vbZzDBzzVhkVg6PrzopRWhC3 Y+RKyomsTc7zfc8sJDsuuXE6irE= 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=O7gh9MBBWl8gQ6fm0STYtZ TTAEA=; b=AwCogKeWiw2zDRd529BknOWutqJUi3k0cJ9mXb0rEbgSVIBmd2OsXx GGzvjrqLturCKU5qOBG7MBRSaRyCBEy/SIOnkgzVMRYuwpCLVTgdyzHiA9cgWct7 NSNVgg//+LHhzWpJQ4jJ9UXbFgqK7YfKYfCa5zgmkWQH/byWAhg8c= Received: (qmail 107985 invoked by alias); 19 Dec 2016 17:58:28 -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 107965 invoked by uid 89); 19 Dec 2016 17:58:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=HReceived-SPF:domain, HReceived-SPF:client-ip, H*r:TLS1_0, opts X-HELO: EUR02-VE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr20066.outbound.protection.outlook.com (HELO EUR02-VE1-obe.outbound.protection.outlook.com) (40.107.2.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Dec 2016 17:58:17 +0000 Received: from DB6PR0802CA0014.eurprd08.prod.outlook.com (10.172.224.24) by HE1PR08MB0858.eurprd08.prod.outlook.com (10.164.53.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8; Mon, 19 Dec 2016 17:58:12 +0000 Received: from DB3FFO11FD011.protection.gbl (2a01:111:f400:7e04::172) by DB6PR0802CA0014.outlook.office365.com (2603:10a6:4:7e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14 via Frontend Transport; Mon, 19 Dec 2016 17:58:12 +0000 Authentication-Results: spf=pass (sender IP is 217.140.96.140) smtp.mailfrom=arm.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; 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 DB3FFO11FD011.mail.protection.outlook.com (10.47.216.167) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.789.10 via Frontend Transport; Mon, 19 Dec 2016 17:58:11 +0000 Received: from e107456-lin.cambridge.arm.com (10.1.2.79) by mail.arm.com (10.1.105.66) with Microsoft SMTP Server id 14.3.294.0; Mon, 19 Dec 2016 17:58:08 +0000 From: James Greenhalgh To: CC: , , , Subject: [Patch] Turn -fexcess-precision=fast on when in -ffast-math Date: Mon, 19 Dec 2016 17:58:06 +0000 Message-ID: <1482170286-35068-1-git-send-email-james.greenhalgh@arm.com> In-Reply-To: References: MIME-Version: 1.0 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)(39850400002)(39840400002)(39410400002)(39450400003)(39860400002)(2980300002)(438002)(24454002)(377424004)(377454003)(54534003)(189002)(199003)(6916009)(110136003)(8936002)(5660300001)(104016004)(512874002)(568964002)(50226002)(92566002)(33646002)(2906002)(626004)(305945005)(84326002)(5890100001)(246002)(8676002)(4610100001)(4326007)(356003)(2476003)(50986999)(76176999)(4001150100001)(39060400001)(38730400001)(2950100002)(106466001)(189998001)(77096006)(36756003)(86362001)(26826002)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR08MB0858; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD011; 1:dzwoPUAZylelESyb1c9ABpRKJ5F7/9q+abMTq1bc05TcjDcNtTC6UmCdmZLJ6S0A6Mgj4cC3gU9ZlHp1B24OmXhG0WpkBqmwzMxujjfb4J4Fsrii1vRTVDFwOFOQceYtNZrm/rqVF+B22VCGdAWt+Ae+1MWCOfLnv/xCplzK7F/MvvjwANBwxHfr8upYBKlWkvtB97kcyO9f2LVCb//uIqZ4rkCrlYCAXLsRueoPf5i8sTQkX5UI1t92Y1+XF2aMtyTnIF/ieHVtvyre4Rc/uQQWJTBYV6gbCbZHbWj2mbx1K2e0W3n2H00QfiqJiAdKv9IaX3mJ1fb4vi1clSZnAJ0XYg8okQJLjYbAeUQJ5JG1LS7jHpK2s3AJYlNMClDXzPAoKRMgnTKRTGk6lTeZBUDYX4boI2qZtRBglSFTMYGacVOk1z6621h1ovikvlS883BBuO37oogH0YJp+gdqeoEtyiAW9rKLB4JT9K1bIzyqxw1ME0aiap86qwkOUK3bQiLnNzlLNnZJpHksdBgvz4av1f7WfQeEuZFEhkgHTaLg5p5AVWF0jVxZ++CBeX5q4XfKSEJU9DKFNt66o6RmY9wowzpNHm2O9lnxmWEUgPk= X-MS-Office365-Filtering-Correlation-Id: f9ea5862-7d15-433a-02ea-08d428389956 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:HE1PR08MB0858; X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0858; 3:+hol+1Ry7wLA8G1x3NUtWFVFTVpFJ9wl5lcAKPHlA19YtdJdj/YnEtlhej1+xoXI1Q8mPDBInIfhEdwQ6AC74qXveuPgdf01kWfBOtvmvup3sRG9A+4S2gsbja8lH3ZF9TUqvGV1yMC5MssG+gfQ6YHtDy1tvmghbNboH5svv2SPuDpaQtl3i4JmuV1LbgPsZh5gZUQolaIzQm2fhrIc2A6YeQyBHb/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YLHGe NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0858; 20:t2ss1lxNHnL0wn/EJ1OK05MVKbw4jx9lE5xLjLlud58SkqEo7+/tyrokzc+oXKbS44FbGVIfMiUksmBSgCCNZMvWooUqXaPDR5x1+W4ILnHZzHuO9sZ6XaGpNCu91wux7HlTw05GZ+gIufvDlSv+E/rspu3uI056k+M7nufchziYFR/+PjKQXw/dxrsQT/v7yUIeX8vK0Ca5DKc5zft7PRuxUDPXNGl1hQKh5NXqbc3u6zl0k0RF7SNzoSslbk2a 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)(13023025)(8121501046)(13020025)(5005006)(13024025)(13013025)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148); SRVR:HE1PR08MB0858; BCL:0; PCL:0; RULEID:; SRVR:HE1PR08MB0858; X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0858; 4:PzKxBWaXbuQLoJ+9mkrdUYV9EjnbvvsKrSLo060ydaqDpEXsNcWXmJ7ngtit5d4fAAj7+4CvrNNVMhk3gun/ktt6ss+j9rLYYDXPLCbBI2jzJhUKN/cTMPzfyZn+93yBD1OIdVztwBR72X4lFr4fjhe789recrIbH+2fmrNQ3fTP1xT77H6ew5OzqPOvT/RFPqjytlEz3dRWQnDanS6ws4UBOVOtvnMHf7z12QJL/msyXz7JXgn+Rme8IBeg9Yt3vvuAgbNDOmjzMGHeH9NOIqk1+WfiTjJci61EbUCMMk5EM+a+ihUDv/nLkc1M8y0A8nRt1CO6ZK7quhc94lADgOtbS9T3U5gYuwogY4dlSS4K1NipIkD3b17xmh5wZYuT8KtbTB026j4MGmweCA1kB+EMpWOGdPFObt+U0TrR5pfameHBrPG3NkGu0AA0L76xYKJaTFmJenlntFbs0rP7IwLBTnahTIbmIia5cScnUvITwykdRO8JyRNLueCaQnZrUCRm+oIUdZcLCFlH7m5KN6LN89P4zn0LYQcoFS3vv8d8HpogPm5ug4tWuy7JN/70UWQPPfcyj8qsu4QLw14b107QidwgVGkHSQjVF7vhL/DvdfJye+0hIVH8I/hj6lnlAxUnRTYgFRtTPTS3f9g2oApvLyOabm7Epa+BdIZqNsYd4THSbkjYFA1lggs9JGH/61xDlxzpg8CJxH1ystBYwMIvwX0o7LLhU4PV3ZZI1gk= X-Forefront-PRVS: 01613DFDC8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR08MB0858; 23:uekcn2e/Gg7VrsPnj4YYkikiSsN2+7c29SQEccOWb?= =?us-ascii?Q?IYbR/ppQStLh/vhiYljdA4EHKLyf27+y3rSI6zqUy5Fy0xzxaNT1LO7a0J3j?= =?us-ascii?Q?vsv9HRY7m/+bzUmjPHMHUolWMk3NorMp4NM77JgfqrB133mT78XhVNzK7yPF?= =?us-ascii?Q?2dvsImbPcwqSVOVYHNqr9/3k0RGU5NIp1K5SP902EJzXULIFp4UDRPA+YePk?= =?us-ascii?Q?B1f7s1hUpzmMYmrGqKUwQLC8kuKys1GBGxbKtE5V9mD8BUsayky1zR44hQIt?= =?us-ascii?Q?BNnsyj70+jGxByjPL/CmJGX5zqKL6S6Jxp2wGEcWRZuXMPy/1DDo3p2wtMV2?= =?us-ascii?Q?70lswDcJd4ENBgaDyF9LLZs6kVrNh0dHA9lMCW0YNaD+1pHOuEIpq6mjD3YA?= =?us-ascii?Q?OgBIbHCoCAJsuRdZhFIFtU/GrW5ZSsZUI5gcW2uT3ry7lsg9OLvYFYGr6esu?= =?us-ascii?Q?g9l1cNlWDmPg2yIj1+K18atdW2kvQyLfBYv7JUFmdR4u4VIEmrzyxX8yMGUs?= =?us-ascii?Q?Oi7NjiHpn9Mei5U7e66J+t4nUPBiOHirg3XaxutPDDYpU2dnaUnj7LDEnW8+?= =?us-ascii?Q?OU/NKh16fBhjeCEBCj5IkQOMx23XUveeTlAiSeTFJWxZaaUMbpttvQPmu55n?= =?us-ascii?Q?tr2Eh/ndy/cyG09VPm+sospdFOapfAkW4i0UxThADwCkb97q4UjdAypUI2+0?= =?us-ascii?Q?fXd1AGtwORbWfqah3PHqRT16ndkEjWVD297Yvvtmp4KosckelTXw1g1d1hIj?= =?us-ascii?Q?Opjw2xawZqFayA4HhA3DaREeL5H4nSejE7IOncLZjvpLQlY8c1PcvkW0sojI?= =?us-ascii?Q?h107kxGpjlBHUos4kGvnQpperoS1MPJCQvp/oNmKcA1vsd0krDv7jkJygSEP?= =?us-ascii?Q?z0Sb3jyvoSKHXeJLjI0qIJKX9nXyHkjmBhDlbw3Q52cYBAzKuQtN6onR4agN?= =?us-ascii?Q?n3g5X4oJofm1L9rhu3aYZIzU+ZDcQ3vLgP4JqBeyR+0jgBky/8gUT/bJ7vNj?= =?us-ascii?Q?Q6bKhU2syZ/uwrKEnIiqqoyXjP+i3RjNfqF/Q6qqVItMnSD4qcIuF4xLD7HQ?= =?us-ascii?Q?6PIwAdY36hVTbfZ0D4AxSdnGHw73pdAHv45zsmEkbJDFwh2GNSpIUkpJJOkD?= =?us-ascii?Q?drXyMxKc5s/+onQflV3at3nE48VnA48u1Liuk1L+ePjecYIaa6CrJ3dtFfSr?= =?us-ascii?Q?3bgvh1sC0gm5VanIFAvQNbRz7WfxA99qRSK582H2yomoYu3lPTe3OsdgQ=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0858; 6:nl535kLSXe3V3XUC2PUsbyAl+S+6BygWNWfRTnjy/gXSWlCsXvoMptzeWJ7W1aM3rYRJMVrIKjccPUzP9YqgLcKxgNiKYUTez5Gg1goinbfwtyAQlevL6ajnxHMjPRqGXUUylQkWF1pqfBYyesar7o/PqGloR6wkElGf5XbL8K46cXe+xGDj/jZy2kzZc6y/ha85l/ZgMBR4XcMk2akmA99Mz3IgDD079iCY7QvyAfYyw8tZXNg5mJswReu38jUNAfiGJB/v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exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2016 17:58:11.9573 (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: HE1PR08MB0858 X-IsSubscribed: yes > On Thu, Dec 8, 2016 at 10:44 PM, Uros Bizjak wrote: > > Hello! > > > > Attached patch fixes fall-out from excess-precision improvements > > patch. As shown in the PR, the code throughout the compiler assumes > > FLAG_PRECISION_FAST when flag_unsafe_math_optimizations flag is in > > effect. The patch puts back two lines, removed by excess-precision > > improvements patch. > > > > 2016-12-08 Uros Bizjak > > > > PR middle-end/78738 > > * toplev.c (init_excess_precision): Initialize flag_excess_precision > > to EXCESS_PRECISION_FAST for flag_unsafe_math_optimizations. > > > > testsuite/ChangeLog: > > > > 2016-12-08 Uros Bizjak > > > > PR middle-end/78738 > > * gcc.target/i386/pr78738.c: New test. > > > > Patch was bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. > > > > OK for mainline? > > Hmm, I think it belongs to set_unsafe_math_optimization_flags instead > (and be consistent if -fexcess-precision was manually specified). I think it would be better if this were implied by -ffast-math/-Ofast than by -funsafe-math-optimizations . That's what I've implemented here, and tagged the option as SetByCombined to allow us to honour what the user requests. This should give us the behaviour you were looking for Uros. I've bootstrapped and tested the behaviour on x86_64, and I've hacked up the AArch64 backend to validate that we're setting the flag in the right circumstances (but that meant changing the AArch64 behaviour, so isn't something we'd want on trunk, and therefore I can't write a testcase for this patch). OK? Thanks, James --- 2016-12-19 James Greenhalgh * common.opt (excess_precision): Tag as SetByCombined. * opts.c (set_fast_math_flags): Also set flag_excess_precision_cmdline. (fast_math_flags_set_p): Also check flag_excess_precision_cmdline. diff --git a/gcc/common.opt b/gcc/common.opt index de06844..6ebaf9c 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -1317,7 +1317,7 @@ Common Report Var(flag_expensive_optimizations) Optimization Perform a number of minor, expensive optimizations. fexcess-precision= -Common Joined RejectNegative Enum(excess_precision) Var(flag_excess_precision_cmdline) Init(EXCESS_PRECISION_DEFAULT) +Common Joined RejectNegative Enum(excess_precision) Var(flag_excess_precision_cmdline) Init(EXCESS_PRECISION_DEFAULT) SetByCombined -fexcess-precision=[fast|standard] Specify handling of excess floating-point precision. Enum diff --git a/gcc/opts.c b/gcc/opts.c index 890da03..5844190 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -2342,6 +2342,10 @@ set_fast_math_flags (struct gcc_options *opts, int set) opts->x_flag_errno_math = !set; if (set) { + if (opts->frontend_set_flag_excess_precision_cmdline + == EXCESS_PRECISION_DEFAULT) + opts->x_flag_excess_precision_cmdline + = set ? EXCESS_PRECISION_FAST : EXCESS_PRECISION_DEFAULT; if (!opts->frontend_set_flag_signaling_nans) opts->x_flag_signaling_nans = 0; if (!opts->frontend_set_flag_rounding_math) @@ -2374,7 +2378,9 @@ fast_math_flags_set_p (const struct gcc_options *opts) && opts->x_flag_unsafe_math_optimizations && opts->x_flag_finite_math_only && !opts->x_flag_signed_zeros - && !opts->x_flag_errno_math); + && !opts->x_flag_errno_math + && opts->x_flag_excess_precision_cmdline + == EXCESS_PRECISION_FAST); } /* Return true iff flags are set as if -ffast-math but using the flags stored