From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3060 invoked by alias); 2 Feb 2014 09:35:11 -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 2992 invoked by uid 48); 2 Feb 2014 09:35:02 -0000 From: "joaquin at tid dot es" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60027] New: Problem with braced-init-lists and explicit ctors Date: Sun, 02 Feb 2014 09:35:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joaquin at tid dot es 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: 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: 2014-02/txt/msg00062.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D60027 Bug ID: 60027 Summary: Problem with braced-init-lists and explicit ctors Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: joaquin at tid dot es The following code compiled with -std=3Dc++11:=20 struct foo=20 {=20 foo(int){}=20 };=20 struct bar=20 {=20 explicit bar(int){}=20 };=20 void f(foo){}=20 void f(bar){}=20 int main()=20 {=20 f({0});=20 }=20 yields: main.cpp:16:8: error: call of overloaded 'f()' is ambiguous=20 f({0});=20 ^=20 main.cpp:16:8: note: candidates are:=20 main.cpp:11:6: note: void f(foo)=20 void f(foo){}=20 ^=20 main.cpp:12:6: note: void f(bar)=20 void f(bar){}=20 ^=20 which seems incorrect as bar::bar(int) is explicit. Joaqu=C3=ADn M L=C3=B3pez Mu=C3=B1oz Telef=C3=B3nica Digital >>From gcc-bugs-return-442306-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Feb 02 11:29:22 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 14098 invoked by alias); 2 Feb 2014 11:29:21 -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 14056 invoked by uid 48); 2 Feb 2014 11:29:15 -0000 From: "wojtek.golf at interia dot pl" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/60028] New: TIC6X: B3 register (return address) is saved on stack when real call is replaced with sibling call in a leaf function Date: Sun, 02 Feb 2014 11:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: wojtek.golf at interia dot pl 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: 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: 2014-02/txt/msg00063.txt.bz2 Content-length: 2237 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60028 Bug ID: 60028 Summary: TIC6X: B3 register (return address) is saved on stack when real call is replaced with sibling call in a leaf function Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: wojtek.golf at interia dot pl GCC 4.8.2, target tic6x Input source: int e_fun(int arg); extern int e_int; void g_fun(void) { e_fun(e_int); } compiled with a command: -fleading-underscore -march=c674x -O2 -g0 -S main.c gives the following assembler code: _g_fun: sub .d2 B15, 8, B15 stw .d2t2 B3, *+B15(8) b .s1 (_e_fun) || ldw .d2t1 *+B14(_e_int), A4 ldw .d2t2 *+B15(8), B3 || add .s2 8, B15, B15 ;; sibcall to (_e_fun) occurs nop 4 where B3 is saved on the stack even though a branch is taken to _e_fun. Texas Instruments CGTools compiler v7.3.2 (cl6x --gcc -mv6740 --symdebug:none -k -n main.c) gives the following assembler code (CALLRET is an alias to B): _g_fun: CALLRET .S1 _e_fun ; |6| LDW .D2T1 *+DP(_e_int),A4 ; |6| NOP 4 $C$RL0: ; CALL-RETURN OCCURS {_e_fun} 0 ; |6| where B3 is not saved. Some investigation on my part leads to the function c6x_expand_call in the file gcc/gcc/config/c6x/c6x.c, where we see what may cause B3 being marked as used and hence saved on the stack prior to the branch: if (sibcall) { call_insn = emit_call_insn (call_insn); use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), gen_rtx_REG (Pmode, REG_B3)); } commenting out use_reg invocation makes gcc to generate the expected listing: _g_fun: b .s1 (_e_fun) || ldw .d2t1 *+B14(_e_int), A4 ;; sibcall to (_e_fun) occurs nop 5 I haven't tested yet whether removal of use_reg invocation causes any regression, but I'd like it to be investigated whether it should be removed altogether or protected with some extra execution condition. With best, Wojciech