From patchwork Wed Aug 7 18:51:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Pluzhnikov X-Patchwork-Id: 265592 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 134C42C0097 for ; Thu, 8 Aug 2013 04:51:51 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=yHCVberIsXQKXKKTwJax3MMNmuhmc6vDo7Gvvvoy76AB9qCgBr +Z2oFaC26FXf8ljP30eoKT+rQ8bXWxKRvBi5Va8XswHMgxpw02l7jSM17mtVirkS 6Q6qdgFNl1+hHFtUHWZ7QQkikCUQ61Fa4sIqGWF6V7mgpY2AuBUHptM2M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; s= default; bh=vPo2BL15Hlf3W7i70f39E6jxPfY=; b=XQofHbPAG/xsCnPexoKj r9SzkMS7mi+7m5qwFqTKVVCTDSEFjZsyVeXqQq1X5+QgOxRIYmZnUX4Etw7C9DjJ hLcicg080Mt/SSWR1pzKjF9Hzxy+G8AewuwRS6wWyXqjb4NFU95OJRCdgFpvFxaD lvn+QOLYQe9zB7fo6wy8czQ= Received: (qmail 13172 invoked by alias); 7 Aug 2013 18:51:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 13160 invoked by uid 89); 7 Aug 2013 18:51:45 -0000 X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RDNS_NONE, SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mail-qe0-f74.google.com) (209.85.128.74) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 07 Aug 2013 18:51:44 +0000 Received: by mail-qe0-f74.google.com with SMTP id 1so229982qec.3 for ; Wed, 07 Aug 2013 11:51:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-type; bh=MqqVb+9fKhHkiiAlmYwPwdzrDMM/UcW6F+ohLZdAaEU=; b=JKEunZhdMxMnYMahFd9l8WZ2oB3CoTgod7KGhZGO8V5Esg3F4Zbnblr2fpWU0ql4ym 0oB+HL/6xIg+eRAqfXzkR88fn/4OtWUn6jNkTqlEe+UNNshbMmVYVWkuCNgWUX4OTMFC 4LMrFZQ57DoOB1I5LdDBJ9ctB5t2Q9Jj6UyDBFMyMQj7iTV2mJ2+fICE7wJMpxHGlBvT I+ceCKM3SGt11fKFU8bfulE0NzGHf9DFPiniTiwRna1HzGisKEjECTiOtzz/k4wBlnUY ErdQ2wnDywGrh8D2vYJFzzEKd5TcMAOdz1nuJMbKlw8Ph/D/WI8DwEOF8ACbHbQ9u8gt oVwg== X-Gm-Message-State: ALoCoQktZ0pG95DlWFKWaVTQJHECRWAyrkbTYxgXFYzEuEKUBG+mUWNMaDA07dRenKZfQT92Lts3qwSR3VeaKCUoUczo9RBq/5xaHB6KaRjMANt0r9NIbNfyQckkIIR92LXHOTBXx6jLSMF4+i1obfLJpypa0IRdELNxayodYVcvoUFsSVG14y5DJ3M7qQjr2yhonzQpddA6OUbjFHxw/v7u7SlvrnosvH6ffFiUW1bgzrGTbjWuLt4= X-Received: by 10.236.54.135 with SMTP id i7mr1995893yhc.33.1375901496343; Wed, 07 Aug 2013 11:51:36 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id c45si637502yhm.2.2013.08.07.11.51.36 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Wed, 07 Aug 2013 11:51:36 -0700 (PDT) Received: from elbrus2.mtv.corp.google.com (elbrus2.mtv.corp.google.com [172.17.128.95]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 2CCEB31C1C0; Wed, 7 Aug 2013 11:51:36 -0700 (PDT) Received: by elbrus2.mtv.corp.google.com (Postfix, from userid 74925) id C38271C0AAA; Wed, 7 Aug 2013 11:51:35 -0700 (PDT) From: Paul Pluzhnikov To: gcc-patches@gcc.gnu.org Cc: ppluzhnikov@google.com, richardsmith@google.com Subject: [patch] Make cxxfilt demangle internal-linkage templates Date: Wed, 07 Aug 2013 11:51:35 -0700 Message-ID: MIME-Version: 1.0 Greetings, I've been redirected here from binutils: http://sourceware.org/ml/binutils/2013-08/msg00052.html http://sourceware.org/ml/binutils/2013-08/msg00056.html The following source: template static void f(); void g() { f(); } results in "_Z1fIiEvv" under g++, but in "_ZL1fIiEvv" under clang. Richard Smith says: The ABI doesn't cover manglings for local symbols ... ... and c++filt is not able to cope with the L prefix here. I'm having a hard time seeing how this isn't a g++ bug and a matching c++filt bug. It's hard for me to argue that this is a 'g++' bug (since there is no ABI violation here), but c++filt should be able to handle this, and does with attached patch. Ok for trunk? Thanks, Google ref: b/10137049 --- Paul Pluzhnikov 2013-08-07 Paul Pluzhnikov * cp-demangle.c (d_name): Handle internal-linkage templates. * testsuite/demangle-expected: New case. Index: libiberty/testsuite/demangle-expected =================================================================== --- libiberty/testsuite/demangle-expected (revision 201577) +++ libiberty/testsuite/demangle-expected (working copy) @@ -4291,3 +4291,6 @@ --format=gnu-v3 _Z1nIM1AKFvvREEvT_ void n(void (A::*)() const &) +--format=gnu-v3 +_ZL1fIiEvv +void f() Index: libiberty/cp-demangle.c =================================================================== --- libiberty/cp-demangle.c (revision 201577) +++ libiberty/cp-demangle.c (working copy) @@ -1276,7 +1276,6 @@ case 'Z': return d_local_name (di); - case 'L': case 'U': return d_unqualified_name (di); @@ -1323,6 +1322,7 @@ return dc; } + case 'L': default: dc = d_unqualified_name (di); if (d_peek_char (di) == 'I')