From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4765 invoked by alias); 17 Jan 2012 10:36:06 -0000 Received: (qmail 4588 invoked by uid 22791); 17 Jan 2012 10:36:06 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Jan 2012 10:35:17 +0000 From: "amker.cheng at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/51867] GCC generates inconsistent code for same sources calling builtin calls, like sqrtf Date: Tue, 17 Jan 2012 10:43:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: X-Bugzilla-Severity: trivial X-Bugzilla-Who: amker.cheng at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-01/txt/msg01874.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51867 --- Comment #3 from amker.cheng 2012-01-17 10:35:14 UTC --- test case c-c++-common/dfp/signbit-2.c depends on this check. the case is like: --------------------------------------------------------------------- /* { dg-options "-O0" } */ /* Check that the compiler uses builtins for signbit; if not the link will fail because library functions are in libm. */ #include "dfp-dbg.h" volatile _Decimal32 sd = 2.3df; volatile _Decimal64 dd = -4.5dd; volatile _Decimal128 tf = 5.3dl; volatile float f = 1.2f; volatile double d = -7.8; volatile long double ld = 3.4L; EXTERN int signbitf (float); EXTERN int signbit (double); EXTERN int signbitl (long double); EXTERN int signbitd32 (_Decimal32); EXTERN int signbitd64 (_Decimal64); EXTERN int signbitd128 (_Decimal128); int main () { if (signbitf (f) != 0) FAILURE if (signbit (d) == 0) FAILURE if (signbitl (ld) != 0) FAILURE if (signbitd32 (sd) != 0) FAILURE if (signbitd64 (dd) == 0) FAILURE if (signbitd128 (tf) != 0) FAILURE FINISH } It is compiled without optimization and will fail if no builtin_* functions are used. Not sure it is intended or not.