From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6156 invoked by alias); 26 Apr 2011 14:18:03 -0000 Received: (qmail 6139 invoked by uid 22791); 26 Apr 2011 14:18:02 -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; Tue, 26 Apr 2011 14:17:48 +0000 From: "gdr at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/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: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gdr at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: paolo.carlini at oracle dot com X-Bugzilla-Target-Milestone: 4.6.1 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: Tue, 26 Apr 2011 14:18: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/msg02634.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48760 --- Comment #14 from Gabriel Dos Reis 2011-04-26 14:12:35 UTC --- (In reply to comment #12) > (In reply to comment #9) > > I guess, in the 4.6.1 time frame we can only workaround the issue in C++03 mode > > by doing the piecewise work in the body. I can maybe help for the compiler work > > too but I need more guidance: is there an agreement about the C1X inspired > > builtin suggested by Joseph? In case, can I have a more specific reference? > > > > I'm adding in CC Richi too, in case he has additional tips and/or hints about > > the builtin work.. > > A __builtin_complex builtin should be almost trivial. It would be purely > frontend sugar for frontends that lack a way to specify a complex value > component-wise. The frontend would be resposible for lowering it to > a COMPLEX_EXPR. I don't think the middle-end wants to deal with > __builtin_complex as it already has a perfect matching tree code. Agreed -- except since __builtin_complex is already a perfect match, the front-end should just accept either _M_value{r,i} or _M_value(r,i) if it wanted to be C++03 compatible too. Either way, you say, there is no need to involve the middle end. > > Now I understand C++0x might have a proper syntax already, so I'm not sure > how it relates to this (C++) bug. > > What changed in 4.6 is that we put complex values in registers even at -O0. that is fine (and appreciated!). It is unrelated to the bug though. > You should be able to reproduce any issue in this bug in older releases > with optimization turned on (given that the library implementation didn't > change). The bug is a source-level bug; the source code is written that way because we don't have yet a good way to initialize at once GCC builtin COMPLEX_EXPR. -- Gaby