From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11999 invoked by alias); 25 Apr 2011 12:42:16 -0000 Received: (qmail 11987 invoked by uid 22791); 25 Apr 2011 12:42:16 -0000 X-SWARE-Spam-Status: No, hits=-2.7 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; Mon, 25 Apr 2011 12:42:02 +0000 From: "paolo.carlini at oracle dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/48760] [4.6 / 4.7 Regression (?)] std::complex constructor buggy in the face of NaN's 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: normal X-Bugzilla-Who: paolo.carlini at oracle dot com X-Bugzilla-Status: UNCONFIRMED 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 Date: Mon, 25 Apr 2011 12:42:00 -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 X-SW-Source: 2011-04/txt/msg02523.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48760 --- Comment #2 from Paolo Carlini 2011-04-25 12:41:59 UTC --- PR24581 can be related, its additional, "unexpected", nans. A C snippet showing the issue would be: int main() { float r = 0; float i = __builtin_nanf (""); __complex__ float c = r + i * 1.0fi; /* __complex__ float c; __real__ c = r; __imag__ c = i; */ __builtin_printf("%f\n", __real__ c); __builtin_printf("%f\n", __imag__ c); } Indeed, I could tweak the library to construct the complex by pieces, avoiding the multiplication by the imaginary constant in the constructor, but the problem would definitely reappear at any following multiplication...