From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23360 invoked by alias); 28 Jun 2004 15:37:32 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 23352 invoked by uid 48); 28 Jun 2004 15:37:31 -0000 Date: Mon, 28 Jun 2004 15:39:00 -0000 Message-ID: <20040628153731.23351.qmail@sourceware.org> From: "ian at wasabisystems dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040628024250.16240.mckelvey@maskull.com> References: <20040628024250.16240.mckelvey@maskull.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug other/16240] [3.4/3.5 Regression] Seg Fault in collect2 (caused by C++ demangling) X-Bugzilla-Reason: CC X-SW-Source: 2004-06/txt/msg03595.txt.bz2 List-Id: ------- Additional Comments From ian at wasabisystems dot com 2004-06-28 15:37 ------- I fixed the bug in the demangler which was causing it to dump core. However, that reveals a bug in the mangled name which g++ is generating. Skipping the analysis of the whole name, here is the end: LZNS_16complement_namesEELZNS_14COMPLEMENTENUMEEEE 'L' means a template argument. 'Z' means a local name 'NS_16complement_namesE' is a nested name (PatternDriver::complement_names) 'E' starts the entity name of the local name At this point we expect to see the name of a variable within the PatternDriver::complement_names class. Instead, we see another template argument. That is wrong. The bug is in write_template_arg(), in the DECL_P case. It has been there for a long time. I suspect that the correct patch is: diff -p -u -r1.101 mangle.c --- mangle.c 1 Apr 2004 03:50:39 -0000 1.101 +++ mangle.c 28 Jun 2004 15:36:01 -0000 @@ -2208,6 +2208,7 @@ write_template_arg (tree node) if (code == CONST_DECL) G.need_abi_warning = 1; write_char ('L'); + write_char ('_'); write_char ('Z'); write_encoding (node); write_char ('E'); Unfortunately, that would be an ABI change. I don't see how to correctly demangle this symbol. -- What |Removed |Added ---------------------------------------------------------------------------- CC| |ian at wasabisystems dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16240