[Bug c++/64346] gcc generates incorrect debug info for ctor/dtor

2024-11-02 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64346

--- Comment #6 from Jason Merrill  ---
(In reply to dehao from comment #3)
> For AutoFDO, we actually needs symbols from the symbol table because
> indirect call promotion needs the symbol name to find the right callee.

I don't understand why the -O0 output is relevant for autofdo; surely you want
to do data collection on an optimized build and then use it on another
optimized build?

We could change debug output so that you see the C1 as an intermediate inline
function, but it's not clear to me why that would be beneficial.

Also, there's no indirect call here, constructors are always called directly.

[Bug c++/64346] gcc generates incorrect debug info for ctor/dtor

2019-11-19 Thread knight4553kai at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64346

knight4553kai at gmx dot com  changed:

   What|Removed |Added

 CC||knight4553kai at gmx dot com

--- Comment #5 from knight4553kai at gmx dot com  
---
dehao, have you tried what Cary suggested? Did it worked for you?
http://ultimatewebtraffic.com

[Bug c++/64346] gcc generates incorrect debug info for ctor/dtor

2014-12-19 Thread ccoutant at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64346

--- Comment #4 from Cary Coutant  ---
I think the problem is that the decloning turns the C1 and C2 ctors into
thunks, and GCC doesn't (yet) generate debug info for thunks, so when you
inline the C4 into the C1 or C2, and inline that into foo, all that's left in
the debug info is the inlined call to the C4 ctor.

It looks like -fno-declone-ctors-dtor doesn't work around the problem because
the "need_alias" flag is true, and that forces the decloning in this case.

The most expedient approach might be for you to alias the C4/D4 names to the
official ones when processing the profile data. Is that feasible?


[Bug c++/64346] gcc generates incorrect debug info for ctor/dtor

2014-12-17 Thread dehao at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64346

--- Comment #3 from dehao at gcc dot gnu.org ---
For AutoFDO, we actually needs symbols from the symbol table because indirect
call promotion needs the symbol name to find the right callee.

You are right, ICF also causes trouble to AutoFDO profile.


[Bug c++/64346] gcc generates incorrect debug info for ctor/dtor

2014-12-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64346

--- Comment #2 from Andrew Pinski  ---
>_ZN3ABCC4Ev

That is the internal name of the function (it demangles to ABC::ABC() anyways)
and the symbol does not need to be in the symbol table at all.

We are going to run into this more with ICF also.  I think there might have
been a RFC about how to handle the debugging for commoning of functions but it
might be a while before that is implemented.


[Bug c++/64346] gcc generates incorrect debug info for ctor/dtor

2014-12-17 Thread dehao at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64346

dehao at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P2
 CC||ccoutant at gcc dot gnu.org,
   ||davidxl at google dot com,
   ||jason at gcc dot gnu.org

--- Comment #1 from dehao at gcc dot gnu.org ---
This may be related to https://gcc.gnu.org/ml/gcc-patches/2013-11/msg02724.html

Jason could you help take a look?