From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30668 invoked by alias); 26 Jun 2010 18:26:52 -0000 Received: (qmail 30625 invoked by uid 48); 26 Jun 2010 18:26:38 -0000 Date: Sat, 26 Jun 2010 18:26:00 -0000 Message-ID: <20100626182638.30624.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/44683] Optimization bug with copysign builtin In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "dickinsm at gmail dot com" 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: 2010-06/txt/msg02578.txt.bz2 ------- Comment #3 from dickinsm at gmail dot com 2010-06-26 18:26 ------- Apologies; I seem to have messed up the original bug report, by accidentally pasting a slightly edited version of the original bug file. The minimal test-case is as follows: #include #include int copysign_bug(double x) { if (x && (x * 0.5 == x)) // note the extra "x &&" here return 1; if (copysign(1.0, x) < 0.0) return 2; else return 3; } int main(void) { double x; x = -0.0; printf("copysign_bug(%.17g) = %d\n", x, copysign_bug(x)); x = 0.0; printf("copysign_bug(%.17g) = %d\n", x, copysign_bug(x)); return 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44683