From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26823 invoked by alias); 24 Oct 2013 12:27:07 -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 26771 invoked by uid 48); 24 Oct 2013 12:27:03 -0000 From: "paolo.carlini at oracle dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/57994] Constant folding of infinity Date: Thu, 24 Oct 2013 12:27: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: paolo.carlini at oracle dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: paolo.carlini at oracle dot com X-Bugzilla-Target-Milestone: 4.9.0 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-10/txt/msg01751.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57994 --- Comment #16 from Paolo Carlini --- Uhm, something isn't going as planned. If I change that check in do_mpfr_arg1 to !real_isnan (ra), then we always fold __builtin_expl(-__builtin_huge_vall()) to an exact 0. However, with *both* -fno-math-errno -funsafe-math-optimizations we don't fold the kind of code we really care about: type num = __builtin_logl(0.0L); type res = __builtin_expl(num); and res turns out to be -nan :( Probably the problem has to do with the log, not sure yet.