From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2229 invoked by alias); 3 Aug 2013 21:23:48 -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 Received: (qmail 2122 invoked by uid 48); 3 Aug 2013 21:23:42 -0000 From: "daniel.kruegler at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58063] default arguments evaluated twice per call Date: Sat, 03 Aug 2013 21:23:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: daniel.kruegler at googlemail 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-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-08/txt/msg00217.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D58063 --- Comment #6 from Daniel Kr=C3=BCgler --- (In reply to Paolo Carlini from comment #5) > Ah, in case isn't obvious already: it only happens when the "I/O expressi= on" > has the ! operator in front. I suspected that and ensured that I added a similar operator! to my ostream model type, but this hadn't any impact on the outcome for that type. Furthe= r, I don't understand how it is related to ostream initialization, because the i= ssue also occurs when we invert the order of the function calls: int main() { f2(); std::cout << "------------------\n"; f(); } gives me: hi! 0 ------------------ hi! hi! 0 Are you sure that this is not due to improper code generation? >>From gcc-bugs-return-427294-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Aug 03 21:31:00 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 13827 invoked by alias); 3 Aug 2013 21:31: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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 13732 invoked by uid 48); 3 Aug 2013 21:30:58 -0000 From: "paolo.carlini at oracle dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58063] default arguments evaluated twice per call Date: Sat, 03 Aug 2013 21:31:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.1 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-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-08/txt/msg00218.txt.bz2 Content-length: 361 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58063 --- Comment #7 from Paolo Carlini --- I'm not at all sure! But it happens with -O0 too, right?, thus at this point the front-end seems more likely than the back-end, I would not change the Component from c++ to something else. In any case we badly need a reduced testcase ;)