From patchwork Mon Mar 3 09:56:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 325745 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 8C1492C00C2 for ; Mon, 3 Mar 2014 20:56:52 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=S0/0Q30fDsIJs2ZEhL epvMkVd43gck4rNRpwjtb7Wxh9RO6Nhg4cgwFjZlm1CeevixZ2TdrKcWYxicz4C9 S0on0o5PKAXiZuhknvSMBXHHUxDmqOqMjm6WU2S3gDVCCCCqNXIyAnq51dbe9vvt vdp6kZb5/WUbQulLF0UB/e0gk= 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 :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=MFdEy6pEZeiCq9PCGoNy6KZm dmU=; b=FPwjEDmtvnnFbYL7UM4P3t6lV0K9h4ypurHrA26iDjeAnz8uQHhguL26 XaVwULpjMbC4NXIuuHxw+f7VoK7EikZc80HrgOr44Sm99a0s2kI6Wq7IHr2B1ohV mLF5GikhRe3g++2ky7krJ64l5ga4ffVpmk4tYaEajJ5pLgs3Dog= Received: (qmail 5381 invoked by alias); 3 Mar 2014 09:56:46 -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 5371 invoked by uid 89); 3 Mar 2014 09:56:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f47.google.com Received: from mail-wg0-f47.google.com (HELO mail-wg0-f47.google.com) (74.125.82.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 03 Mar 2014 09:56:45 +0000 Received: by mail-wg0-f47.google.com with SMTP id x12so405800wgg.6 for ; Mon, 03 Mar 2014 01:56:41 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.179.69 with SMTP id de5mr16144866wjc.4.1393840601754; Mon, 03 Mar 2014 01:56:41 -0800 (PST) Received: by 10.194.62.111 with HTTP; Mon, 3 Mar 2014 01:56:41 -0800 (PST) In-Reply-To: References: Date: Mon, 3 Mar 2014 10:56:41 +0100 Message-ID: Subject: Re: [PATCH] [lto/55113] Fix use of -fshort-double with -flto for powerpc From: Richard Biener To: "Paulo J. Matos" Cc: GCC Patches X-IsSubscribed: yes On Sat, Mar 1, 2014 at 11:23 PM, Paulo J. Matos wrote: > > This patch fixes lto/55113 for powerpc. > Combining -fshort-double with -flto is now working fine. > > I attach patch and testcase (unsure if testcase is in the right place). > Tested with target powerpc-abispe. > > > 2014-03-01 Paulo Matos > > * c-family/c.opt: Add LTO FE support for fshort-double option. > * tree-streamer.c (record_common_node): Assert we don't record > nodes with type double. > (preload_common_node): Skip type double, complex double and > double pointer since it is now frontend dependent due to > fshort-double option. > > 2014-03-01 Paulo Matos > > * gcc.target/powerpc/pr55113.c: New testcase. > > > OK to commit? that doesn't seem to be run with -flto nor -fshort-double. The proper place for a testcase is gcc.dg/lto/ with sth like { dg-lto-do link } { dg-lto-options { { -O2 -fshort-double -flto } } } and naming the testcase pr55113_0.c. Your testcase doens't use doubles at all ... (well, ok, a + b * 1e-12 uses them implicitely, but for that we have fsingle-precision-constant) Richard. > -- > PMatos Index: gcc/c-family/c.opt =================================================================== --- gcc/c-family/c.opt (revision 208249) +++ gcc/c-family/c.opt (working copy) @@ -1141,7 +1141,7 @@ C++ ObjC++ Optimization Var(flag_rtti) I Generate run time type descriptor information fshort-double -C ObjC C++ ObjC++ Optimization Var(flag_short_double) +C ObjC C++ ObjC++ LTO Optimization Var(flag_short_double) Use the same size for double as for float This hunk isn't needed. Index: gcc/testsuite/gcc.target/powerpc/pr55113.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/pr55113.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/pr55113.c (working copy) @@ -0,0 +1,11 @@ +#include + +int main() +{ + static float f; + float a = 1.0; + float b = 2.0; + f = a + b * 1e-12; + printf("%f\n", f); + return 0; +}