From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53556 invoked by alias); 30 Jul 2019 06:57:51 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 53547 invoked by uid 89); 30 Jul 2019 06:57:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 Jul 2019 06:57:50 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D99434A6FB; Tue, 30 Jul 2019 06:57:48 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-108.ams2.redhat.com [10.36.116.108]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ECFED600F8; Tue, 30 Jul 2019 06:57:47 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x6U6viSj022436; Tue, 30 Jul 2019 08:57:45 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x6U6vdsL022435; Tue, 30 Jul 2019 08:57:39 +0200 Date: Tue, 30 Jul 2019 07:05:00 -0000 From: Jakub Jelinek To: Richard Biener , Rainer Orth , Mike Stump , "Joseph S. Myers" , Tamar Christina Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix up gcc.dg/type-convert-var.c testcase (was Re: [GCC][middle-end] Add rules to strip away unneeded type casts in expressions (2nd patch)) Message-ID: <20190730065739.GG15878@tucnak> Reply-To: Jakub Jelinek References: <20190625083126.GA19632@arm.com> <20190702094115.GA22370@arm.com> <20190702164351.GA12197@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190702164351.GA12197@arm.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg01749.txt.bz2 On Tue, Jul 02, 2019 at 04:43:54PM +0000, Tamar Christina wrote: > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/type-convert-var.c > @@ -0,0 +1,9 @@ > +/* { dg-do compile } */ > +/* { dg-additional-options "-O1 -fdump-tree-optimized" } */ > +void foo (float a, float b, float *c) > +{ > + double e = (double)a * (double)b; > + *c = (float)e; > +} > + > +/* { dg-final { scan-tree-dump-not {double} "optimized" } } */ > This new testcase FAILs e.g. on i686-linux. The problem is that with no dg-options, the testcase options default to -ansi, which implies -fexcess-precision=standard. On i686-linux, that is conversion to long double which must (and does) survive until expansion. Fixed by using -fexcess-precision=fast, tested on x86_64-linux and i686-linux, ok for trunk? 2019-07-30 Jakub Jelinek * gcc.dg/type-convert-var.c: Add -0fexcess-precision=fast to dg-additional-options. --- gcc/testsuite/gcc.dg/type-convert-var.c.jj 2019-07-28 17:29:27.156351325 +0200 +++ gcc/testsuite/gcc.dg/type-convert-var.c 2019-07-30 08:51:33.349558035 +0200 @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-additional-options "-O1 -fdump-tree-optimized" } */ +/* { dg-additional-options "-fexcess-precision=fast -O1 -fdump-tree-optimized" } */ void foo (float a, float b, float *c) { double e = (double)a * (double)b; Jakub