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

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Created attachment 42693
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42693&action=edit
reduced testcase

trippels@gcc67 ~ % g++ -g -flto -r -nostdlib -O2 test_environment.ii
node_buffer.ii
node_buffer.ii:98:10: warning: type ‘struct AsyncHooks’ violates the C++ One
Definition Rule [-Wodr]
   struct AsyncHooks {
          ^
test_environment.ii:117:10: note: a different type is defined in another
translation unit
   struct AsyncHooks {
          ^
node_buffer.ii:99:39: note: the first difference of corresponding definitions
is field ‘providers_’
     int providers_[B::PROVIDERS_LENGTH];
                                       ^
test_environment.ii:118:67: note: a field of same name but different type is
defined in another translation unit
     v8::Eternal<v8::String> providers_[AsyncWrap::PROVIDERS_LENGTH];
                                                                   ^

lto1: internal compiler error: in linemap_ordinary_map_lookup, at
libcpp/line-map.c:995
0x139f7a4 linemap_ordinary_map_lookup
        ../../gcc/libcpp/line-map.c:995
0x139f7a4 linemap_lookup(line_maps*, unsigned int)
        ../../gcc/libcpp/line-map.c:948
0x13a068b linemap_macro_loc_to_def_point
        ../../gcc/libcpp/line-map.c:1453
0x13a068b linemap_resolve_location(line_maps*, unsigned int,
location_resolution_kind, line_map_ordinary const**)
        ../../gcc/libcpp/line-map.c:1585
0x136bb45 diagnostic_report_current_module(diagnostic_context*, unsigned int)
        ../../gcc/gcc/diagnostic.c:581
0xb0a6b1 diagnostic_report_current_function(diagnostic_context*,
diagnostic_info*)
        ../../gcc/gcc/tree-diagnostic.c:39
0xb0a6f0 default_tree_diagnostic_starter
        ../../gcc/gcc/tree-diagnostic.c:48
0x136a48a diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        ../../gcc/gcc/diagnostic.c:985
0x136a84e diagnostic_impl
        ../../gcc/gcc/diagnostic.c:1108
0x136aa98 inform(unsigned int, char const*, ...)
        ../../gcc/gcc/diagnostic.c:1160
0x895b21 odr_types_equivalent_p
        ../../gcc/gcc/ipa-devirt.c:1569
0x89664e add_type_duplicate
        ../../gcc/gcc/ipa-devirt.c:1848
0x89664e get_odr_type(tree_node*, bool)
        ../../gcc/gcc/ipa-devirt.c:2028
0x89b9e4 odr_subtypes_equivalent_p
        ../../gcc/gcc/ipa-devirt.c:689
0x895740 odr_types_equivalent_p
        ../../gcc/gcc/ipa-devirt.c:1556
0x89664e add_type_duplicate
        ../../gcc/gcc/ipa-devirt.c:1848
0x89664e get_odr_type(tree_node*, bool)
        ../../gcc/gcc/ipa-devirt.c:2028
0x89bbd9 register_odr_type(tree_node*)
        ../../gcc/gcc/ipa-devirt.c:2111
0x5efea7 lto_read_decls
        ../../gcc/gcc/lto/lto.c:1748
0x5f14d4 lto_file_finalize
        ../../gcc/gcc/lto/lto.c:2048
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/home/trippels/bin/ld: fatal error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Also happens without -g -O2:
~ % g++ -flto -r -nostdlib test_environment.ii node_buffer.ii

Reply via email to