Bug 79976 - long list of demangle failures
Summary: long list of demangle failures
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: demangler (show other bugs)
Version: 7.0.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-09 10:37 UTC by Markus Trippelsdorf
Modified: 2017-03-13 08:55 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2017-03-09 00:00:00


Attachments
demangler failure list (6.04 KB, text/plain)
2017-03-09 10:37 UTC, Markus Trippelsdorf
Details
Pedro's patch updated for trunk (1.36 KB, patch)
2017-03-09 10:38 UTC, Markus Trippelsdorf
Details | Diff
list of testsuite demangler failures (5.50 KB, text/plain)
2017-03-09 12:20 UTC, Markus Trippelsdorf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Trippelsdorf 2017-03-09 10:37:10 UTC
Created attachment 40931 [details]
demangler failure list

The demangler currently doesn't demangle any of the symbols in the attached file:
 % c++filt < demangler_failures

llvm-cxxfilt correctly demangles most of them.

The list was generated by using Pedro's mangler/demangler dogfooding patch
https://gcc.gnu.org/ml/gcc-patches/2014-05/msg02277.html
and then building gcc, llvm and Firefox with patched gcc trunk.
Comment 1 Markus Trippelsdorf 2017-03-09 10:38:29 UTC
Created attachment 40932 [details]
Pedro's patch updated for trunk
Comment 2 Pedro Alves 2017-03-09 11:13:36 UTC
Thanks for looking at that!

I'd love for that patch to me merged, but realistically, I don't know when I'd have time to champion it, and it's been almost 3 years...  If someone picks it up and runs with it, it's much appreciated.

FYI, Jason provided feedback in the following month:
 https://gcc.gnu.org/ml/gcc-patches/2014-06/msg00082.html

but I never followed through, and I have no other local changes.
Comment 3 Markus Trippelsdorf 2017-03-09 11:25:56 UTC
The patch slows down the compiler immensely, so I don't think it should be enabled by flag_checking. A new -enable-checking= option would be best.

I will test if Jason's suggestion makes any difference.
Comment 4 Pedro Alves 2017-03-09 11:37:52 UTC
That's a good point.  Maybe a mangling/demangling hash/cache would help with that, though can't beat 0 work.
Comment 5 Markus Trippelsdorf 2017-03-09 12:20:48 UTC
Created attachment 40935 [details]
list of testsuite demangler failures
Comment 6 Markus Trippelsdorf 2017-03-09 13:24:37 UTC
Jason's idea doesn't help much. 
For the demangler failures of the testsuite there are only 9 less (<2%).
Comment 7 Markus Trippelsdorf 2017-03-13 08:55:51 UTC
One big chunk of failures is due to the following:

markus@x4 tmp % cat mangl.ii
struct C;
template <class T> struct B {
  template <class U> operator B<U>();
  T *operator->();
};
struct D {
  B<C> tmp;
  template <class T> void m_fn1(T p1) { tmp = p1; }
};
struct E;
void fn1() {
  B<D> l;
  B<E> m;
  l->m_fn1(m);
}

markus@x4 tmp % g++ -O2 -c mangl.ii && nm -C mangl.o
0000000000000000 T fn1()
                 U B<D>::operator->()
                 U _ZN1BI1EEcvS_IT_EI1CEEv

markus@x4 tmp % llvm-cxxfilt _ZN1BI1EEcvS_IT_EI1CEEv
B<E>::operator B<C><C>()


The second <C> in "B<C><C>" is not handled.