Comments

On Thu, May 10, 2018 at 9:58 AM, Martin Liška <mliska@suse.cz> wrote:
> Hi.>> It's removal of an assert at place where we calculate hash of a type.> For incomplete types, let's skip it.>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.>> Ready to be installed?
Seems to be a redundant check in the !val case as well. Also why not
at least do
hstate2.add_int (RECORD_TYPE);
for incomplete types? That said, your patch fixes the ICE but what
is supposed to happen for incomplete types? Note that with LTO
we no longer "complete" types so you can see a mix of struct S;
and struct S { .... }; in the IL. It looks like comparison later just
looks at types_compatible_p here.
Anyway, please at least remove the other redundant assert.
Thanks,
Richard.
> Martin>>> gcc/ChangeLog:>> 2018-05-09 Martin Liska <mliska@suse.cz>>> PR ipa/85607> * ipa-icf.c (sem_item::add_type): Do not ICE for incomplete types.>> gcc/testsuite/ChangeLog:>> 2018-05-09 Martin Liska <mliska@suse.cz>>> PR ipa/85607> * g++.dg/ipa/pr85606.C: New test.> ---> gcc/ipa-icf.c | 5 ++++-> gcc/testsuite/g++.dg/ipa/pr85606.C | 14 ++++++++++++++> 2 files changed, 18 insertions(+), 1 deletion(-)> create mode 100644 gcc/testsuite/g++.dg/ipa/pr85606.C>>