From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28345 invoked by alias); 26 Jul 2013 15:13:51 -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 28268 invoked by uid 48); 26 Jul 2013 15:13:48 -0000 From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/57994] New: Constant folding of infinity Date: Fri, 26 Jul 2013 15:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: UNCONFIRMED 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter Message-ID: 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/msg01282.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57994 Bug ID: 57994 Summary: Constant folding of infinity Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: glisse at gcc dot gnu.org double f(){ return __builtin_exp(-__builtin_huge_val()); } As noticed in PR57974, we fail to fold this to a constant. Indeed, in do_mpfr_arg1, the relevant code is protected by if (real_isfinite (ra) ... mpfr handles infinite values, so it should be doable, at least with -ffast-math (there might be some errno issues with default options).