From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103494 invoked by alias); 22 Jul 2015 13:37:29 -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 98160 invoked by uid 48); 22 Jul 2015 13:37:25 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/66968] New: Incorrect template argument shown in diagnostic Date: Wed, 22 Jul 2015 13:37: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: 6.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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 keywords bug_severity priority component assigned_to reporter target_milestone 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: 2015-07/txt/msg01905.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D66968 Bug ID: 66968 Summary: Incorrect template argument shown in diagnostic Product: gcc Version: 6.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- Compiling this invalid code produces an error as expected: template struct thing { }; template bool operator=3D=3D(const thing&, const thing&); struct nested { typedef int name; }; template void func(typename A::name const&, const B) { } template void func(typename A::name const&, const thing) { } int main() { thing ti; func(1, ti); } However the error has an error: y.cc: In function =E2=80=98int main()=E2=80=99: y.cc:17:21: error: call of overloaded =E2=80=98func(int, thing&)=E2=80= =99 is ambiguous func(1, ti); ^ y.cc:9:6: note: candidate: void func(const typename A::name&, B) [with A =3D nested; B =3D thing; typename A::name =3D int] void func(typename A::name const&, const B) { } ^ y.cc:12:6: note: candidate: void func(const typename A::name&, thing) [with A =3D nested; B =3D int; typename A::name =3D int] void func(typename A::name const&, const thing) { } ^ Note that the second candidate shows thing, where does that XXX come from?! The "[with ...]" output correctly shows the template parameter B but B does= n't appear in the candidate. For some reason XXX is shown instead, which is only ever mentioned in the operator=3D=3D declaration above, which is never used! >>From gcc-bugs-return-493016-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jul 22 13:52:47 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 13913 invoked by alias); 22 Jul 2015 13:52:47 -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 13704 invoked by uid 48); 22 Jul 2015 13:52:42 -0000 From: "julien.blanc at laposte dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/60621] std::vector::emplace_back generates massively more code than push_back Date: Wed, 22 Jul 2015 13:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.7.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: julien.blanc at laposte dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: cc 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: 2015-07/txt/msg01906.txt.bz2 Content-length: 1008 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D60621 julien.blanc at laposte dot net changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julien.blanc at laposte do= t net --- Comment #5 from julien.blanc at laposte dot net --- Testing a bit, it really looks like the issue resides in how and where the temporary string objects are created. Changing marc=E2=80=99s code to have struct S { S(const char* a, const char * b, const char *c); }; makes it reverting back to only 0.3k more text (which can be explained beca= use two emplace_back function instanciation are needed vs one), and better insertion performance (insertion time is worse otherwise, which breaks emplace_back purpose). The same goes if strings are constructed before being passed to S construct= or. (see new attachment). Looks like an optimizer issue to me. (note : tested with gcc 4.9.2) >>From gcc-bugs-return-493017-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jul 22 13:53:41 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 34771 invoked by alias); 22 Jul 2015 13:53:41 -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 34751 invoked by uid 48); 22 Jul 2015 13:53:37 -0000 From: "julien.blanc at laposte dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/60621] std::vector::emplace_back generates massively more code than push_back Date: Wed, 22 Jul 2015 13:53:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.7.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: julien.blanc at laposte dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: attachments.created 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: 2015-07/txt/msg01907.txt.bz2 Content-length: 232 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60621 --- Comment #6 from julien.blanc at laposte dot net --- Created attachment 36032 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36032&action=edit New version of marc's code