From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81069 invoked by alias); 17 Aug 2017 15:43:30 -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 81041 invoked by uid 89); 17 Aug 2017 15:43:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=clarifications, offer X-HELO: smtp.ispras.ru Received: from bran.ispras.ru (HELO smtp.ispras.ru) (83.149.199.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Aug 2017 15:43:25 +0000 Received: from monopod.intra.ispras.ru (monopod.intra.ispras.ru [10.10.3.121]) by smtp.ispras.ru (Postfix) with ESMTP id 0B7C15FB79; Thu, 17 Aug 2017 18:43:23 +0300 (MSK) Date: Thu, 17 Aug 2017 16:58:00 -0000 From: Alexander Monakov To: Wilco Dijkstra cc: Richard Biener , GCC Patches , nd Subject: Re: [PATCH v2] Simplify pow with constant In-Reply-To: Message-ID: References: ,, User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2017-08/txt/msg01089.txt.bz2 On Thu, 17 Aug 2017, Wilco Dijkstra wrote: > This patch simplifies pow (C, x) into exp (x * C1) if C > 0, C1 = log (C). Note this changes the outcome for C == +Inf, x == 0 (pow is specified to return 1.0 in that case, but x * C1 == NaN). There's another existing transform with the same issue, 'pow(expN(x), y) -> expN(x*y)', so this is not a new problem. The whole set of these match.pd transforms is guarded by flag_unsafe_math_optimizations, which is a bit strange, on the one hand it does not include -ffinite-math-only, but on the other hand it's defined broadly enough to imply that. (to be clear, I'm not objecting to the patch, just pointing out an existing inconsistency in case someone can offer clarifications) Alexander