* [Bug c++/40831] g++ generated symbols for cloned function that be demangled.
[not found] <bug-40831-4@http.gcc.gnu.org/bugzilla/>
@ 2011-01-05 1:07 ` d.g.gorbachev at gmail dot com
2011-01-06 14:45 ` hubicka at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2011-01-05 1:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831
Dmitry Gorbachev <d.g.gorbachev at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |d.g.gorbachev at gmail dot
| |com
--- Comment #5 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 2011-01-05 01:07:00 UTC ---
There's also a binutils bug <http://sourceware.org/PR12337>:
> Programs objdump, nm, addr2line, c++filt, gprof, do not demangle cloned
> function names, such as _ZN1C3fooEi.isra.0. Could be C::foo.isra.0(int) or
> C::foo(int).isra.0 (?)
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/40831] g++ generated symbols for cloned function that be demangled.
[not found] <bug-40831-4@http.gcc.gnu.org/bugzilla/>
2011-01-05 1:07 ` [Bug c++/40831] g++ generated symbols for cloned function that be demangled d.g.gorbachev at gmail dot com
@ 2011-01-06 14:45 ` hubicka at gcc dot gnu.org
2011-02-23 7:08 ` ccoutant at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-06 14:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831
Jan Hubicka <hubicka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.01.06 14:07:31
CC| |dj at redhat dot com,
| |hubicka at gcc dot gnu.org,
| |ian at airs dot com
Ever Confirmed|0 |1
Severity|normal |enhancement
--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-06 14:07:31 UTC ---
We certainly can improve libiberty demangler to handle the cloning suffixes.
It would not hurt and is certainly nice thing to have. I am not terribly
familiar with demnagler implementation so I would preffer someone else to do
it.
Concerning question how _ZN1C3fooEi.isra.0. should be demangled, I think we
already use english sentences for some functions names like "static constructor
keyed to XYZ", so probably we can go "C::foo(int) isra clone 0" or we even can
go further and expand the abbrebiated names GCC use for different types of
clones.
For most of purposes however the tools should use debug info that contains the
correct link back to original function...
Marking as enhancement request and adding our libiberty maintainers into CC.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/40831] g++ generated symbols for cloned function that be demangled.
[not found] <bug-40831-4@http.gcc.gnu.org/bugzilla/>
2011-01-05 1:07 ` [Bug c++/40831] g++ generated symbols for cloned function that be demangled d.g.gorbachev at gmail dot com
2011-01-06 14:45 ` hubicka at gcc dot gnu.org
@ 2011-02-23 7:08 ` ccoutant at gcc dot gnu.org
2011-02-23 9:04 ` d.g.gorbachev at gmail dot com
` (9 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: ccoutant at gcc dot gnu.org @ 2011-02-23 7:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831
Cary Coutant <ccoutant at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot |ccoutant at gcc dot gnu.org
|gnu.org |
--- Comment #7 from Cary Coutant <ccoutant at gcc dot gnu.org> 2011-02-23 02:00:08 UTC ---
Created attachment 23439
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23439
Patch to add demangler support for cloned function symbols
include/ChangeLog:
PR 40831
* demangle.h (enum demangle_component_type): Add
DEMANGLE_COMPONENT_CLONE, DEMANGLE_COMPONENT_CONSTPROP_CLONE,
DEMANGLE_COMPONENT_ISRA_CLONE, DEMANGLE_COMPONENT_PART_CLONE.
libiberty/ChangeLog:
PR 40831
* cp-demangle.c (struct clone_suffix_list): New type.
(d_make_comp): Add new component types.
(cplus_demangle_mangled_name): Check for clone suffixes.
(d_parmlist): Don't error out if we see '.'.
(clone_suffixes): New array.
(d_clone_suffix): New function.
(d_print_comp): Print info for clone suffixes.
* testsuite/demangle-expected: Add new testcases.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/40831] g++ generated symbols for cloned function that be demangled.
[not found] <bug-40831-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2011-02-23 7:08 ` ccoutant at gcc dot gnu.org
@ 2011-02-23 9:04 ` d.g.gorbachev at gmail dot com
2011-02-23 18:46 ` ccoutant at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2011-02-23 9:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831
--- Comment #8 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 2011-02-23 07:53:45 UTC ---
Does not work for `_Z3fooi.1988' or
`_Z3fooi.part.9.165493.constprop.775.31805'.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/40831] g++ generated symbols for cloned function that be demangled.
[not found] <bug-40831-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2011-02-23 9:04 ` d.g.gorbachev at gmail dot com
@ 2011-02-23 18:46 ` ccoutant at gcc dot gnu.org
2011-02-23 19:46 ` hubicka at ucw dot cz
` (7 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: ccoutant at gcc dot gnu.org @ 2011-02-23 18:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831
--- Comment #9 from Cary Coutant <ccoutant at gcc dot gnu.org> 2011-02-23 18:30:19 UTC ---
> Does not work for `_Z3fooi.1988' or
> `_Z3fooi.part.9.165493.constprop.775.31805'.
Where does the _Z3fooi.1988 style come from?
I guess your second example is from a cloned function (due to partial inlining)
that got cloned again (due to constant propagation), but why are there two
numbers on each?
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/40831] g++ generated symbols for cloned function that be demangled.
[not found] <bug-40831-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2011-02-23 18:46 ` ccoutant at gcc dot gnu.org
@ 2011-02-23 19:46 ` hubicka at ucw dot cz
2011-08-20 3:35 ` ccoutant at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: hubicka at ucw dot cz @ 2011-02-23 19:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831
--- Comment #10 from Jan Hubicka <hubicka at ucw dot cz> 2011-02-23 19:03:36 UTC ---
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831
>
> --- Comment #9 from Cary Coutant <ccoutant at gcc dot gnu.org> 2011-02-23 18:30:19 UTC ---
> > Does not work for `_Z3fooi.1988' or
> > `_Z3fooi.part.9.165493.constprop.775.31805'.
>
> Where does the _Z3fooi.1988 style come from?
We add the .1234 suffixes in LTO for local symbols (to avoid clashes in between
two static
variables of the same name).
As WHOPR progress, we might end up adding two numbered suffixes, because we
mangle at wpa time and then ship the mangled symbols to ltrans when we mangle
again. Disabling the second mangling is trivial, but no one did it yet. The
first mangling happens even when tere are no conflicts that is stupid, but in
case of conflicts it needs to happen.
>
> I guess your second example is from a cloned function (due to partial inlining)
> that got cloned again (due to constant propagation), but why are there two
> numbers on each?
_Z3fooi.1988 is created from _Z3fooi by LTO mangling.
We also do precisely same mangling from function static variables, i.e.
test()
{
static int a;
}
will get out a as a.1234
_Z3fooi becomes _Z3fooi.part.9 by partial inlining
.165493 is added at WPA time because function is static (all partial functions
are)
.constprop.775 is added because one of argument was proved to be constant by
cprop pass
.31805 comes from (completely redundant) name mangling at ltrans time.
It is possible to change way we mangle the LTO vars, if neccesary for some good
reason.
Those numbered suffixes that do not come from function versioning (i.e. don't
have .part or .constprop) are redundant, so I guess they might be just silently
dropped?
Honza
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/40831] g++ generated symbols for cloned function that be demangled.
[not found] <bug-40831-4@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2011-02-23 19:46 ` hubicka at ucw dot cz
@ 2011-08-20 3:35 ` ccoutant at gcc dot gnu.org
2011-09-23 21:47 ` ccoutant at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: ccoutant at gcc dot gnu.org @ 2011-08-20 3:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831
Cary Coutant <ccoutant at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #23439|0 |1
is obsolete| |
--- Comment #11 from Cary Coutant <ccoutant at gcc dot gnu.org> 2011-08-20 00:54:56 UTC ---
Created attachment 25060
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25060
Updated patch to demangle cloned function symbols
This patch generalizes the clone suffix recognition, so it accepts a series of
suffixes of the form [.clonetype][.nnn]....
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/40831] g++ generated symbols for cloned function that be demangled.
[not found] <bug-40831-4@http.gcc.gnu.org/bugzilla/>
` (6 preceding siblings ...)
2011-08-20 3:35 ` ccoutant at gcc dot gnu.org
@ 2011-09-23 21:47 ` ccoutant at gcc dot gnu.org
2011-09-24 12:35 ` d.g.gorbachev at gmail dot com
` (4 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: ccoutant at gcc dot gnu.org @ 2011-09-23 21:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831
--- Comment #12 from Cary Coutant <ccoutant at gcc dot gnu.org> 2011-09-23 21:39:13 UTC ---
Author: ccoutant
Date: Fri Sep 23 21:39:10 2011
New Revision: 179132
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179132
Log:
include/ChangeLog:
PR 40831
* demangle.h (enum demangle_component_type): Add
DEMANGLE_COMPONENT_CLONE.
libiberty/ChangeLog:
PR 40831
* cp-demangle.c (d_make_comp): Add new component type.
(cplus_demangle_mangled_name): Check for clone suffixes.
(d_parmlist): Don't error out if we see '.'.
(d_clone_suffix): New function.
(d_print_comp): Print info for clone suffixes.
* testsuite/demangle-expected: Add new testcases.
Modified:
trunk/include/ChangeLog
trunk/include/demangle.h
trunk/libiberty/ChangeLog
trunk/libiberty/cp-demangle.c
trunk/libiberty/testsuite/demangle-expected
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/40831] g++ generated symbols for cloned function that be demangled.
[not found] <bug-40831-4@http.gcc.gnu.org/bugzilla/>
` (7 preceding siblings ...)
2011-09-23 21:47 ` ccoutant at gcc dot gnu.org
@ 2011-09-24 12:35 ` d.g.gorbachev at gmail dot com
2011-09-26 18:32 ` ccoutant at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2011-09-24 12:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831
--- Comment #13 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 2011-09-24 10:39:28 UTC ---
Thanks!
It would be nice to fix it in binutils and in gdb as well.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/40831] g++ generated symbols for cloned function that be demangled.
[not found] <bug-40831-4@http.gcc.gnu.org/bugzilla/>
` (8 preceding siblings ...)
2011-09-24 12:35 ` d.g.gorbachev at gmail dot com
@ 2011-09-26 18:32 ` ccoutant at gcc dot gnu.org
2011-09-26 20:06 ` ccoutant at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: ccoutant at gcc dot gnu.org @ 2011-09-26 18:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831
--- Comment #14 from Cary Coutant <ccoutant at gcc dot gnu.org> 2011-09-26 18:29:52 UTC ---
Author: ccoutant
Date: Mon Sep 26 18:29:46 2011
New Revision: 179209
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179209
Log:
include/ChangeLog:
PR 40831
* demangle.h (enum demangle_component_type): Add
DEMANGLE_COMPONENT_CLONE.
libiberty/ChangeLog:
PR 40831
* cp-demangle.c (d_make_comp): Add new component type.
(cplus_demangle_mangled_name): Check for clone suffixes.
(d_parmlist): Don't error out if we see '.'.
(d_clone_suffix): New function.
(d_print_comp): Print info for clone suffixes.
* testsuite/demangle-expected: Add new testcases.
Modified:
branches/gcc-4_6-branch/ (props changed)
branches/gcc-4_6-branch/include/ChangeLog
branches/gcc-4_6-branch/include/demangle.h
branches/gcc-4_6-branch/libiberty/ChangeLog
branches/gcc-4_6-branch/libiberty/cp-demangle.c
branches/gcc-4_6-branch/libiberty/testsuite/demangle-expected
Propchange: branches/gcc-4_6-branch/
('svn:mergeinfo' added)
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/40831] g++ generated symbols for cloned function that be demangled.
[not found] <bug-40831-4@http.gcc.gnu.org/bugzilla/>
` (9 preceding siblings ...)
2011-09-26 18:32 ` ccoutant at gcc dot gnu.org
@ 2011-09-26 20:06 ` ccoutant at gcc dot gnu.org
2011-10-19 0:02 ` pinskia at gcc dot gnu.org
2011-10-19 0:04 ` pinskia at gcc dot gnu.org
12 siblings, 0 replies; 17+ messages in thread
From: ccoutant at gcc dot gnu.org @ 2011-09-26 20:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831
Cary Coutant <ccoutant at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #15 from Cary Coutant <ccoutant at gcc dot gnu.org> 2011-09-26 18:33:38 UTC ---
Fixed on trunk and in gcc-4_6-branch.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/40831] g++ generated symbols for cloned function that be demangled.
[not found] <bug-40831-4@http.gcc.gnu.org/bugzilla/>
` (10 preceding siblings ...)
2011-09-26 20:06 ` ccoutant at gcc dot gnu.org
@ 2011-10-19 0:02 ` pinskia at gcc dot gnu.org
2011-10-19 0:04 ` pinskia at gcc dot gnu.org
12 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-10-19 0:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |andi-gcc at firstfloor dot
| |org
--- Comment #16 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-10-19 00:00:47 UTC ---
*** Bug 50783 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/40831] g++ generated symbols for cloned function that be demangled.
[not found] <bug-40831-4@http.gcc.gnu.org/bugzilla/>
` (11 preceding siblings ...)
2011-10-19 0:02 ` pinskia at gcc dot gnu.org
@ 2011-10-19 0:04 ` pinskia at gcc dot gnu.org
12 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-10-19 0:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831
--- Comment #17 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-10-19 00:01:54 UTC ---
(In reply to comment #13)
> It would be nice to fix it in binutils and in gdb as well.
libiberty should be merged automatically ...
^ permalink raw reply [flat|nested] 17+ messages in thread