https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87754

            Bug ID: 87754
           Summary: [9 regression] ICE in odr_types_equivalent_p, at
                    ipa-devirt.c:1250
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: hubicka at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---
            Target: i386-pc-solaris2.11, sparc-sun-solaris2.11

Between 20181024 (r265465) and 20181025 (r265498), the following error occured
on Solaris 11/x86 and SPARC, both 32 and 64-bit:

+ERROR: couldn't compile regular expression pattern: quantifier operand invalid
+ERROR: tcl error sourcing
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/lto/lto.exp.

This was caused by throwing lto.exp off-balance.  The underlying ICE is this:

/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/lto/odr-1_0.C:3:8: warning:
type 'struct a' violates the C++ One Definition Rule [-Wodr]
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/lto/odr-1_1.C:4:8: note: a
different type is defined in another translation unit
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/lto/odr-1_0.C:4:13: note: the
first difference of corresponding definitions is field 'ptr'
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/lto/odr-1_1.C:5:13: note: a
field of same name but different type is defined in another translation unit
lto1: internal compiler error: in odr_types_equivalent_p, at ipa-devirt.c:1250
0x71b7a7 odr_types_equivalent_p
        /vol/gcc/src/hg/trunk/local/gcc/ipa-devirt.c:1250
0x71b7a7 odr_types_equivalent_p
        /vol/gcc/src/hg/trunk/local/gcc/ipa-devirt.c:1242
0x71ccf3 odr_types_equivalent_p(tree_node*, tree_node*)
        /vol/gcc/src/hg/trunk/local/gcc/ipa-devirt.c:1648
0x71cd9b type_mismatch_p
        /vol/gcc/src/hg/trunk/local/gcc/ipa-devirt.c:1027
0x71d1cf warn_types_mismatch(tree_node*, tree_node*, unsigned int, unsigned
int)
        /vol/gcc/src/hg/trunk/local/gcc/ipa-devirt.c:1172
0x71c517 odr_types_equivalent_p
        /vol/gcc/src/hg/trunk/local/gcc/ipa-devirt.c:1559
0x71c517 odr_types_equivalent_p
0x71c517 odr_types_equivalent_p
        /vol/gcc/src/hg/trunk/local/gcc/ipa-devirt.c:1242
0x717dd3 add_type_duplicate
        /vol/gcc/src/hg/trunk/local/gcc/ipa-devirt.c:1855
0x717dd3 get_odr_type(tree_node*, bool)
        /vol/gcc/src/hg/trunk/local/gcc/ipa-devirt.c:2035
0x3f6847 lto_read_decls
        /vol/gcc/src/hg/trunk/local/gcc/lto/lto.c:1900
0x3f7f33 lto_file_finalize
        /vol/gcc/src/hg/trunk/local/gcc/lto/lto.c:2134
0x3f7f33 lto_create_files_from_ids
        /vol/gcc/src/hg/trunk/local/gcc/lto/lto.c:2144
0x3f7f33 lto_file_read
        /vol/gcc/src/hg/trunk/local/gcc/lto/lto.c:2185
0x3f7f33 read_cgraph_and_symbols
        /vol/gcc/src/hg/trunk/local/gcc/lto/lto.c:2865
0x3f7f33 lto_main()
        /vol/gcc/src/hg/trunk/local/gcc/lto/lto.c:3401

And has obviously been caused by

changeset:   49043:8f8f242f9f43
user:        hubicka@138bc75d-0d04-0410-961f-82ee72b054a4
date:        Thu Oct 25 12:18:28 2018 +0000
files:       gcc/ChangeLog gcc/ipa-devirt.c gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lto/odr-1_0.C gcc/testsuite/g++.dg/lto/odr-1_1.C
description:
* ipa-devirt.c (odr_types_equivalent_p): Do not ICE if one of types
        is anonymous.
        * g++.dg/lto/odr-1_0.C: New test.
        * g++.dg/lto/odr-1_1.C: New test.

Reply via email to