From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28274 invoked by alias); 21 Feb 2019 17:00:40 -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 27359 invoked by uid 89); 21 Feb 2019 17:00:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=wilcodijkstraarmcom, sk:wilcod, sk:WilcoD, sk:wilco.d X-HELO: mail-wr1-f68.google.com Received: from mail-wr1-f68.google.com (HELO mail-wr1-f68.google.com) (209.85.221.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Feb 2019 17:00:20 +0000 Received: by mail-wr1-f68.google.com with SMTP id v13so31397857wrw.5 for ; Thu, 21 Feb 2019 09:00:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:cc:from:message-id; bh=a/SqJfe9BZwBC+LS/C9hgEcXQgaJFRziqEckfoMrGrM=; b=YzMjDBXBirLjQJ5QkD6p0GRDMrpslaD0xiNSIfWN0wId6HGJEMEdhX3CJ5vMdjWkbn 4LZMC0X7JwGntko4/OROKMgfNuOUeqWHH4gsLP29UuMMfZSerNFSyaB9+Ala7h4LigbC SCyK57vh/uxDlHXRWvq51DE6pMYdR/2h7s7CzQXPfYOh9VB0W5NlYwmasc3tkL0HufhI kbgpsGV69a/WKSIYguNHf9Bdv+8AIHwCaMhd7ThWx125/BMkedxVlgD2a3w0sSMh4AUH ixfYmPW3zYV/bt9AjBuMEMY7BzRJnmt6REvcAbrOFXzNO+IUuJY24ymNO4U6YXibTADt a38g== Return-Path: Received: from [192.168.178.32] (x5f7352c5.dyn.telefonica.de. [95.115.82.197]) by smtp.gmail.com with ESMTPSA id i13sm38473488wrm.86.2019.02.21.09.00.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 09:00:11 -0800 (PST) Date: Thu, 21 Feb 2019 17:06:00 -0000 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] Fix PR89437 To: gcc-patches@gcc.gnu.org,Wilco Dijkstra ,GCC Patches CC: nd From: Richard Biener Message-ID: <82582A0A-F1A4-43A8-89C0-30362BA87785@gmail.com> X-IsSubscribed: yes X-SW-Source: 2019-02/txt/msg01744.txt.bz2 On February 21, 2019 4:55:57 PM GMT+01:00, Wilco Dijkstra wrote: >Fix PR89437. Fix the sinatan-1.c testcase to not run without >a C99 target system. Use nextafterl for long double initialization. OK.=20 >Fix an issue with sinl (atanl (sqrtl (LDBL_MAX)) returning 0.0 >instead of 1.0 by using x < sqrtl (LDBL_MAX) in match.pd. Wasn't that a intermediate problem with the mpfr exponent range limiting?=20 Please check whether that's still needed.=20 Richard.=20 >OK for commit? > >ChangeLog: >2019-02-21 Wilco Dijkstra > > gcc/ > * match.pd: Use lt in sin(atan(x)) and cos(atan(x)) simplifications. > > testsuite/ > * gcc.dg/sinatan-1.c: Fix testcase. >-- >diff --git a/gcc/match.pd b/gcc/match.pd >index >bccf4df05a2f94785446719b3097b3f912fafe96..c9af2e59441c4fe19e88d94c9d138ae3= 5dfe673f >100644 >--- a/gcc/match.pd >+++ b/gcc/match.pd >@@ -4407,7 +4407,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) > tree t_one =3D build_one_cst (type); > } > (if (SCALAR_FLOAT_TYPE_P (type)) >- (cond (le (abs @0) { t_cst; }) >+ (cond (lt (abs @0) { t_cst; }) > (rdiv @0 (sqrts (plus (mult @0 @0) { t_one; }))) > (copysigns { t_one; } @0)))))) >=20 >@@ -4427,7 +4427,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) > tree t_zero =3D build_zero_cst (type); > } > (if (SCALAR_FLOAT_TYPE_P (type)) >- (cond (le (abs @0) { t_cst; }) >+ (cond (lt (abs @0) { t_cst; }) > (rdiv { t_one; } (sqrts (plus (mult @0 @0) { t_one; }))) > (copysigns { t_zero; } @0)))))) >=20 >diff --git a/gcc/testsuite/gcc.dg/sinatan-1.c >b/gcc/testsuite/gcc.dg/sinatan-1.c >index >6a3995ae07949a423e416592276171b6e6f8c816..cfbb771a018d3175c680dce88e0121e4= 69716edc >100644 >--- a/gcc/testsuite/gcc.dg/sinatan-1.c >+++ b/gcc/testsuite/gcc.dg/sinatan-1.c >@@ -1,4 +1,4 @@ >-/* { dg-do run } */ >+/* { dg-do run { target c99_runtime } } */ > /* { dg-options "-Ofast" } */ > /* { dg-add-options ieee } */ >=20 >@@ -62,7 +62,7 @@ main() > /* Get first x such that 1 + x*x will overflow */ > float fc =3D nextafterf (sqrtf (__FLT_MAX__ - 1), __FLT_MAX__); > double c =3D nextafter (sqrt (__DBL_MAX__ - 1), __DBL_MAX__); >- long double lc =3D nextafter (sqrtl (__LDBL_MAX__ - 1), >__LDBL_MAX__); >+ long double lc =3D nextafterl (sqrtl (__LDBL_MAX__ - 1), >__LDBL_MAX__); >=20 > /* Force move from FPU to memory, otherwise comparison may > fail due to possible more accurate registers (see 387) */