From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30322 invoked by alias); 25 Jun 2010 20:22:09 -0000 Received: (qmail 29911 invoked by uid 48); 25 Jun 2010 20:21:39 -0000 Date: Fri, 25 Jun 2010 20:22:00 -0000 Message-ID: <20100625202139.29910.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/44583] [4.6 Regression] c-c++-common/torture/complex-sign-add.c In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sje at cup dot hp 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/msg02511.txt.bz2 ------- Comment #3 from sje at cup dot hp dot com 2010-06-25 20:21 ------- I see this failure on ia64 linux and hp-ux. The interesting thing is that it fails when compiled with C++ but not when compiled with C. Here is a smaller test case that shows that the imaginary part of c1 is +0 in the good case (compiled with C) and -0 in the bad case (compiled with C++). This only shows up when not doing any optimization (-O0) because with optimization everything seems to get correctly folded. #ifdef __cplusplus extern "C" { #endif extern void exit(int); int printf(const char *format, ...); #ifdef __cplusplus } #endif int main (void) { _Complex float a1, b1, c1; a1 = 0.0f + 0.0if; b1 = 0.0f - 0.0if; c1 = a1 + b1; if (__builtin_copysignf (1.0, __imag__ (a1)) != + 1.0) printf("one\n"); if (__builtin_copysignf (1.0, __imag__ (b1)) != - 1.0) printf("two\n"); if (__builtin_copysignf (1.0, __imag__ (c1)) != + 1.0) printf("three\n"); printf("%f\n",__imag__ (c1)); exit (0); } -- sje at cup dot hp dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sje at cup dot hp dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44583