From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28549 invoked by alias); 27 Jul 2013 20:10:08 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 28251 invoked by uid 48); 27 Jul 2013 20:10:04 -0000 From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/57994] Constant folding of infinity Date: Sat, 27 Jul 2013 20:10:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: glisse at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-07/txt/msg01340.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57994 --- Comment #6 from Marc Glisse --- (In reply to Paolo Carlini from comment #5) > Today I was thinking that given that, per docs and testsuite (double checked > yesterday) the mpfr functions are able to cope with +-Inf arguments to the > mathematical functions and evaluate correctly, gating the various do_mpfr_* > with !real_isnan instead of real_isfinite doesn't look like taking a big > risk, now that we are in Stage 1. Alone that would help a lot of code (in > particular, in the C++ library, which is the original motivating example). > Note, I'm not thinking replacing real_isfinite in various other places, in > particular not in do_mpc_* and its helpers (something for the future). > Comments? I haven't looked at that code closely enough to say if there is much that needs changing. Earlier you said that removing the real_isfinite test replaced sin(Inf) with NaN. Was that with -ffast-math? Without it, the change shouldn't happen (not without inserting a few extra statements). I am hoping that there is already code in place that checks if the mpfr calls set errno and calls mpfr_overflow_p (and family) for possible exceptions, though I somehow doubt that we test mpfr_inexflag_p or very little propagation would take place.