Check for TYPE_DECL in get_odr_name_for_type
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 10 Dec 2019 09:17:34 +0000 (09:17 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 10 Dec 2019 09:17:34 +0000 (09:17 +0000)
commitc175aa77aa8a4ba1d950f2db8c66cee004888212
treee0e7b28f231b9b7921cce8533c7e8ea2744ba78b
parent8cf23a6f80d47aff386a9a260d198696b50c9416
Check for TYPE_DECL in get_odr_name_for_type

Make get_odr_name_for_type check for TYPE_DECL in the way that
its caller warn_types_mismatch previously did.

2019-12-10  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* ipa-utils.h (get_odr_name_for_type): Check for a TYPE_DECL.
* ipa-devirt.c (warn_types_mismatch): Don't call xstrdup for the
second demangled name.

gcc/testsuite/
* gcc.dg/lto/tag-1_0.c, gcc.dg/lto/tag-1_1.c: New test.

From-SVN: r279159
gcc/ChangeLog
gcc/ipa-devirt.c
gcc/ipa-utils.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lto/tag-1_0.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/tag-1_1.c [new file with mode: 0644]