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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #5)
> (In reply to Richard Biener from comment #4)
> > Hmm, I can no longer reproduce -g0 vs -g on x86_64-linux.  Ians testresults
> > now
> > list
> > 
> > FAIL: g++.dg/asan/pr62017.C   -O2 -flto  (internal compiler error)
> > FAIL: g++.dg/asan/pr62017.C   -O2 -flto  (test for excess errors)
> > FAIL: g++.dg/asan/pr62017.C   -O2 -flto -flto-partition=none  (internal
> > compiler error)
> > FAIL: g++.dg/asan/pr62017.C   -O2 -flto -flto-partition=none  (test for
> > excess errors)
> > FAIL: g++.dg/asan/pr78651.C   -O2 -flto  (internal compiler error)
> > FAIL: g++.dg/asan/pr78651.C   -O2 -flto  (test for excess errors)
> > FAIL: g++.dg/asan/pr78651.C   -O2 -flto -flto-partition=none  (internal
> > compiler error)
> > FAIL: g++.dg/asan/pr78651.C   -O2 -flto -flto-partition=none  (test for
> > excess errors)
> > 
> > but I can't reproduce with pr62017.C or pr78651.C either right now.
> 
> 81021 has indeed started to pass (I didn't notice when).
> 
> ===== 62017 is:
> 
> $ /XC/9.4/usr/bin/lldb --
> /scratch/10-12-sie/gcc-trunk-unpatched/gcc/testsuite/g++/../../lto1 -fPIC
> -feliminate-unused-debug-symbols -quiet -dumpdir ./ -dumpbase pr62017.exe
> -mmacosx-version-min=10.12.0 -mtune=core2 -m32 -mmacosx-version-min=10.12.0
> -mtune=core2 -auxbase-strip pr62017.exe.lto.o -g -O2 -O2 -version
> -fdiagnostics-color=never -fno-openmp -fno-openacc -fPIC -fsanitize=address
> -fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
> -fmessage-length=0 -flto-partition=none
> @/var/folders/tj/17r7407j14d324dzf67cnvxm000114/T//ccyWmZmy -o pr62017.s
> (lldb) target create
> "/scratch/10-12-sie/gcc-trunk-unpatched/gcc/testsuite/g++/../../lto1"
> Current executable set to
> '/scratch/10-12-sie/gcc-trunk-unpatched/gcc/testsuite/g++/../../lto1'
> (x86_64).
> (lldb) settings set -- target.run-args  "-fPIC"
> "-feliminate-unused-debug-symbols" "-quiet" "-dumpdir" "./" "-dumpbase"
> "pr62017.exe" "-mmacosx-version-min=10.12.0" "-mtune=core2" "-m32"
> "-mmacosx-version-min=10.12.0" "-mtune=core2" "-auxbase-strip"
> "pr62017.exe.lto.o" "-g" "-O2" "-O2" "-version" "-fdiagnostics-color=never"
> "-fno-openmp" "-fno-openacc" "-fPIC" "-fsanitize=address"
> "-fno-diagnostics-show-caret" "-fno-diagnostics-show-line-numbers"
> "-fmessage-length=0" "-flto-partition=none"
> "@/var/folders/tj/17r7407j14d324dzf67cnvxm000114/T//ccyWmZmy" "-o"
> "pr62017.s"
> (lldb) b internal_error
> Breakpoint 1: where = lto1`internal_error(char const*, ...) + 121 [inlined]
> _ZN21auto_diagnostic_groupC4Ev, address = 0x00000001010abcb9
> (lldb) r
> Process 22051 launched:
> '/scratch/10-12-sie/gcc-trunk-unpatched/gcc/testsuite/g++/../../lto1'
> (x86_64)
> GNU GIMPLE (GCC) version 9.0.0 20190114 (experimental) [trunk revision
> 267925] (x86_64-apple-darwin16)
>       compiled by GNU C version 9.0.0 20190114 (experimental) [trunk revision
> 267925], GMP version 6.1.2, MPFR version 3.1.6, MPC version 1.1.0, isl
> version isl-0.20-GMP
> 
> GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
> GNU GIMPLE (GCC) version 9.0.0 20190114 (experimental) [trunk revision
> 267925] (x86_64-apple-darwin16)
>       compiled by GNU C version 9.0.0 20190114 (experimental) [trunk revision
> 267925], GMP version 6.1.2, MPFR version 3.1.6, MPC version 1.1.0, isl
> version isl-0.20-GMP
> 
> GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
> Process 22051 stopped
> * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
> (code=1, address=0x0)
>     frame #0: 0x0000000100f7a941 lto1`tree_to_shwi(t=0x0000000000000000) at
> tree.c:7169
>    7166       tree_fits_shwi_p (const_tree t)
>    7167       {
>    7168         return (t != NULL_TREE
> -> 7169                 && TREE_CODE (t) == INTEGER_CST
>    7170                 && wi::fits_shwi_p (wi::to_widest (t)));
>    7171       }
>    7172       
> Target 0: (lto1) stopped.
> (lldb) bt
> * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
> (code=1, address=0x0)
>   * frame #0: 0x0000000100f7a941 lto1`tree_to_shwi(t=0x0000000000000000) at
> tree.c:7169
>     frame #1: 0x00000001007ddb3b
> lto1`::add_data_member_location_attribute(die=0x000000014482b9b0,
> decl=0x00000001448250c0, ctx=<unavailable>) at dwarf2out.c:19306
>     frame #2: 0x00000001007e6c3e lto1`::gen_struct_or_union_type_die(tree,
> dw_die_ref, debug_info_usage) at dwarf2out.c:24580
>     frame #3: 0x00000001007e6b29
> lto1`::gen_struct_or_union_type_die(type=0x0000000144826000,
> context_die=0x000000014482b000, usage=<unavailable>)
>     frame #4: 0x00000001007e205e
> lto1`::gen_tagged_type_die(type=0x0000000144826000,
> context_die=<unavailable>, usage=DINFO_USAGE_DIR_USE) at dwarf2out.c:25430
>     frame #5: 0x00000001007e248f
> lto1`::gen_typedef_die(decl=0x0000000144821558,
> context_die=0x000000014482b000) at dwarf2out.c:25344
>     frame #6: 0x00000001007e2a15
> lto1`::gen_decl_die(decl=0x0000000144821558, origin=<unavailable>,
> ctx=<unavailable>, context_die=0x000000014482b000) at dwarf2out.c:26314
>     frame #7: 0x00000001007c5ef3
> lto1`::gen_type_die_with_usage(type=0x0000000144826000,
> context_die=<unavailable>, usage=DINFO_USAGE_DIR_USE) at dwarf2out.c:25495
>     frame #8: 0x00000001007c785a
> lto1`::gen_type_die(type=0x0000000144826000, context_die=<unavailable>) at
> dwarf2out.c:25679
>     frame #9: 0x00000001007c80b0
> lto1`::modified_type_die(type=0x0000000144826000, cv_quals=0,
> reverse=<unavailable>, context_die=0x000000014482b870) at dwarf2out.c:13373
>     frame #10: 0x00000001007ca931
> lto1`::add_type_attribute(object_die=0x000000014482b8c0, type=<unavailable>,
> cv_quals=<unavailable>, reverse=<unavailable>, context_die=<unavailable>) at
> dwarf2out.c:21601
>     frame #11: 0x00000001007e6c2e lto1`::gen_struct_or_union_type_die(tree,
> dw_die_ref, debug_info_usage) at dwarf2out.c:24578
>     frame #12: 0x00000001007e6b29
> lto1`::gen_struct_or_union_type_die(type=0x00000001448260a8,
> context_die=0x000000014482b000, usage=<unavailable>)
>     frame #13: 0x00000001007e205e
> lto1`::gen_tagged_type_die(type=0x00000001448260a8,
> context_die=<unavailable>, usage=DINFO_USAGE_DIR_USE) at dwarf2out.c:25430
>     frame #14: 0x00000001007e248f
> lto1`::gen_typedef_die(decl=0x00000001448217b8,
> context_die=0x000000014482b000) at dwarf2out.c:25344
>     frame #15: 0x00000001007e2a15
> lto1`::gen_decl_die(decl=0x00000001448217b8, origin=<unavailable>,
> ctx=<unavailable>, context_die=0x000000014482b000) at dwarf2out.c:26314
>     frame #16: 0x00000001007c5ef3
> lto1`::gen_type_die_with_usage(type=0x00000001448260a8,
> context_die=<unavailable>, usage=DINFO_USAGE_DIR_USE) at dwarf2out.c:25495
>     frame #17: 0x00000001007c785a
> lto1`::gen_type_die(type=0x00000001448260a8, context_die=<unavailable>) at
> dwarf2out.c:25679
>     frame #18: 0x00000001007c80b0
> lto1`::modified_type_die(type=0x00000001448260a8, cv_quals=0,
> reverse=<unavailable>, context_die=0x000000014482b690) at dwarf2out.c:13373
>     frame #19: 0x00000001007ca931
> lto1`::add_type_attribute(object_die=0x000000014482b7d0, type=<unavailable>,
> cv_quals=<unavailable>, reverse=<unavailable>, context_die=<unavailable>) at
> dwarf2out.c:21601
>     frame #20: 0x00000001007bdf53
> lto1`::gen_variable_die(decl=0x0000000142ce0e10, origin=<unavailable>,
> context_die=0x000000014482b690) at dwarf2out.c:23843
>     frame #21: 0x00000001007e2c3b
> lto1`::gen_decl_die(decl=0x0000000142ce0e10, origin=0x0000000000000000,
> ctx=0x0000000000000000, context_die=0x000000014482b690) at dwarf2out.c:26371
>     frame #22: 0x00000001007c01dd
> lto1`::process_scope_var(stmt=0x00000001448252a0, decl=0x0000000142ce0e10,
> origin=<unavailable>, context_die=0x000000014482b690) at dwarf2out.c:25832
>     frame #23: 0x00000001007c06c9
> lto1`::decls_for_scope(stmt=0x00000001448252a0,
> context_die=0x000000014482b690, recurse=<unavailable>) at dwarf2out.c:25858
>     frame #24: 0x00000001007c19c7
> lto1`::gen_subprogram_die(decl=<unavailable>, context_die=<unavailable>) at
> dwarf2out.c:23328
>     frame #25: 0x00000001007e2705
> lto1`::gen_decl_die(decl=0x0000000144824100, origin=0x0000000000000000,
> ctx=0x0000000000000000, context_die=0x000000014482b000) at dwarf2out.c:26288
>     frame #26: 0x00000001007e428b
> lto1`::dwarf2out_decl(decl=0x0000000144824100) at dwarf2out.c:26856
>     frame #27: 0x00000001007e4d5f
> lto1`::dwarf2out_function_decl(decl=<unavailable>) at dwarf2out.c:26871
>     frame #28: 0x0000000100851128
> lto1`pass_final::execute(this=<unavailable>, (null)=<unavailable>) const at
> final.c:4695
>     frame #29: 0x0000000100b814af
> lto1`execute_one_pass(pass=0x0000000143811c20) at passes.c:2483
>     frame #30: 0x0000000100b81b63
> lto1`::execute_pass_list_1(pass=0x0000000143811c20) at passes.c:2569
>     frame #31: 0x0000000100b81b75
> lto1`::execute_pass_list_1(pass=0x0000000143811740) at passes.c:2570
>     frame #32: 0x0000000100b81b75
> lto1`::execute_pass_list_1(pass=0x000000014380fac0) at passes.c:2570
>     frame #33: 0x0000000100b81ba2
> lto1`execute_pass_list(fn=0x000000014482d000, pass=<unavailable>) at
> passes.c:2580
>     frame #34: 0x00000001006eb445
> lto1`cgraph_node::expand(this=0x0000000143d24438) at cgraphunit.c:2196
>     frame #35: 0x00000001006ec322 lto1`symbol_table::compile() at
> cgraphunit.c:2334
>     frame #36: 0x00000001006ec221
> lto1`symbol_table::compile(this=0x0000000143d25100)
>     frame #37: 0x0000000100030ff0 lto1`lto_main() at lto.c:3390
>     frame #38: 0x0000000100c982ca lto1`::compile_file() at toplev.c:456
>     frame #39: 0x0000000101710faf lto1`toplev::main(int, char**) at
> toplev.c:2176
>     frame #40: 0x0000000101710e7b lto1`toplev::main(this=0x00007fff5fbff68e,
> argc=<unavailable>, argv=<unavailable>)
>     frame #41: 0x0000000101713821 lto1`main(argc=31,
> argv=0x00007fff5fbff6c8) at main.c:39
>     frame #42: 0x00007fff9e132235 libdyld.dylib`start + 1
>     frame #43: 0x00007fff9e132235 libdyld.dylib`start + 1
> (lldb) 

OK, that's PR88046 for which I have a patch in my tree.

> 
> =========  pr78651 is:
> 
> $ /XC/9.4/usr/bin/lldb --
> /scratch/10-12-sie/gcc-trunk-unpatched/gcc/testsuite/g++2/../../lto1 -fPIC
> -feliminate-unused-debug-symbols -quiet -dumpdir ./ -dumpbase pr78651.exe
> -mmacosx-version-min=10.12.0 -mtune=core2 -m32 -mmacosx-version-min=10.12.0
> -mtune=core2 -auxbase-strip pr78651.exe.lto.o -g -O2 -O2 -version
> -fdiagnostics-color=never -fno-openmp -fno-openacc -fsanitize=address
> -fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
> -fmessage-length=0 -flto-partition=none -fpic
> @/var/folders/tj/17r7407j14d324dzf67cnvxm000114/T//ccUkv7Up -o pr78651.s
> (lldb) target create
> "/scratch/10-12-sie/gcc-trunk-unpatched/gcc/testsuite/g++2/../../lto1"
> Current executable set to
> '/scratch/10-12-sie/gcc-trunk-unpatched/gcc/testsuite/g++2/../../lto1'
> (x86_64).
> (lldb) settings set -- target.run-args  "-fPIC"
> "-feliminate-unused-debug-symbols" "-quiet" "-dumpdir" "./" "-dumpbase"
> "pr78651.exe" "-mmacosx-version-min=10.12.0" "-mtune=core2" "-m32"
> "-mmacosx-version-min=10.12.0" "-mtune=core2" "-auxbase-strip"
> "pr78651.exe.lto.o" "-g" "-O2" "-O2" "-version" "-fdiagnostics-color=never"
> "-fno-openmp" "-fno-openacc" "-fsanitize=address"
> "-fno-diagnostics-show-caret" "-fno-diagnostics-show-line-numbers"
> "-fmessage-length=0" "-flto-partition=none" "-fpic"
> "@/var/folders/tj/17r7407j14d324dzf67cnvxm000114/T//ccUkv7Up" "-o"
> "pr78651.s"
> (lldb) b internal_error
> r
> Breakpoint 1: where = lto1`internal_error(char const*, ...) + 121 [inlined]
> _ZN21auto_diagnostic_groupC4Ev, address = 0x00000001010abcb9
> (lldb) r
> Process 22101 launched:
> '/scratch/10-12-sie/gcc-trunk-unpatched/gcc/testsuite/g++2/../../lto1'
> (x86_64)
> GNU GIMPLE (GCC) version 9.0.0 20190114 (experimental) [trunk revision
> 267925] (x86_64-apple-darwin16)
>       compiled by GNU C version 9.0.0 20190114 (experimental) [trunk revision
> 267925], GMP version 6.1.2, MPFR version 3.1.6, MPC version 1.1.0, isl
> version isl-0.20-GMP
> 
> GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
> GNU GIMPLE (GCC) version 9.0.0 20190114 (experimental) [trunk revision
> 267925] (x86_64-apple-darwin16)
>       compiled by GNU C version 9.0.0 20190114 (experimental) [trunk revision
> 267925], GMP version 6.1.2, MPFR version 3.1.6, MPC version 1.1.0, isl
> version isl-0.20-GMP
> 
> GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
> Process 22101 stopped
> * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
>     frame #0: 0x00000001010abcb9 lto1`internal_error(char const*, ...)
> [inlined] _ZN21auto_diagnostic_groupC4Ev(this=<unavailable>) at
> diagnostic.c:1616
>    1613       
>    1614       auto_diagnostic_group::auto_diagnostic_group ()
>    1615       {
> -> 1616         global_dc->diagnostic_group_nesting_depth++;
>    1617       }
>    1618       
>    1619       /* Destructor: "pop" this group from global_dc.  */
> Target 0: (lto1) stopped.
> (lldb) bt
> * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
>   * frame #0: 0x00000001010abcb9 lto1`internal_error(char const*, ...)
> [inlined] _ZN21auto_diagnostic_groupC4Ev(this=<unavailable>) at
> diagnostic.c:1616
>     frame #1: 0x00000001010abcb9 lto1`internal_error(gmsgid="in %s, at
> %s:%d")
>     frame #2: 0x000000010170bf9c lto1`fancy_abort(file=<unavailable>,
> line=<unavailable>, function=<unavailable>) at diagnostic.c:1607
>     frame #3: 0x00000001015991fc lto1`lhd_decl_printable_name(tree_node*,
> int) at langhooks.c:222
>     frame #4: 0x00000001007b4288 lto1`::add_pubtype(decl=0x0000000143e25f18,
> die=0x0000000143e27f50) at dwarf2out.c:11333
>     frame #5: 0x00000001007e70f1
> lto1`::gen_struct_or_union_type_die(type=0x0000000143e25f18,
> context_die=<unavailable>, usage=<unavailable>) at dwarf2out.c:25256
>     frame #6: 0x00000001007e205e
> lto1`::gen_tagged_type_die(type=0x0000000143e25f18,
> context_die=<unavailable>, usage=DINFO_USAGE_DIR_USE) at dwarf2out.c:25430
>     frame #7: 0x00000001007e248f
> lto1`::gen_typedef_die(decl=0x0000000143e214c0,
> context_die=0x0000000143e27190) at dwarf2out.c:25344
>     frame #8: 0x00000001007e2a15
> lto1`::gen_decl_die(decl=0x0000000143e214c0, origin=<unavailable>,
> ctx=<unavailable>, context_die=0x0000000143e27190) at dwarf2out.c:26314
>     frame #9: 0x00000001007c5ef3
> lto1`::gen_type_die_with_usage(type=0x0000000143e25f18,
> context_die=<unavailable>, usage=DINFO_USAGE_DIR_USE) at dwarf2out.c:25495
>     frame #10: 0x00000001007c785a
> lto1`::gen_type_die(type=0x0000000143e25f18, context_die=<unavailable>) at
> dwarf2out.c:25679
>     frame #11: 0x00000001007c80b0
> lto1`::modified_type_die(type=0x0000000143e25f18, cv_quals=0,
> reverse=<unavailable>, context_die=0x0000000143e27e60) at dwarf2out.c:13373
>     frame #12: 0x00000001007ca931
> lto1`::add_type_attribute(object_die=0x0000000143e27eb0, type=<unavailable>,
> cv_quals=<unavailable>, reverse=<unavailable>, context_die=<unavailable>) at
> dwarf2out.c:21601
>     frame #13: 0x00000001007bdf53
> lto1`::gen_variable_die(decl=0x0000000142ce0e10, origin=<unavailable>,
> context_die=0x0000000143e27e60) at dwarf2out.c:23843
>     frame #14: 0x00000001007e2c3b
> lto1`::gen_decl_die(decl=0x0000000142ce0e10, origin=0x0000000000000000,
> ctx=0x0000000000000000, context_die=0x0000000143e27e60) at dwarf2out.c:26371
>     frame #15: 0x00000001007c01dd
> lto1`::process_scope_var(stmt=0x0000000143e2c540, decl=0x0000000142ce0e10,
> origin=<unavailable>, context_die=0x0000000143e27e60) at dwarf2out.c:25832
>     frame #16: 0x00000001007c06c9
> lto1`::decls_for_scope(stmt=0x0000000143e2c540,
> context_die=0x0000000143e27e60, recurse=<unavailable>) at dwarf2out.c:25858
>     frame #17: 0x00000001007e9dd4 lto1`::gen_block_die(tree, dw_die_ref) at
> dwarf2out.c:24180
>     frame #18: 0x00000001007e9d0c
> lto1`::gen_block_die(stmt=0x0000000143e2c540, context_die=<unavailable>)
>     frame #19: 0x00000001007c076f
> lto1`::decls_for_scope(stmt=0x0000000143e2c4e0,
> context_die=0x0000000143e27af0, recurse=<unavailable>) at dwarf2out.c:25887
>     frame #20: 0x00000001007c19c7
> lto1`::gen_subprogram_die(decl=<unavailable>, context_die=<unavailable>) at
> dwarf2out.c:23328
>     frame #21: 0x00000001007e2705
> lto1`::gen_decl_die(decl=0x0000000143e24300, origin=0x0000000000000000,
> ctx=0x0000000000000000, context_die=0x0000000143e27190) at dwarf2out.c:26288
>     frame #22: 0x00000001007e428b
> lto1`::dwarf2out_decl(decl=0x0000000143e24300) at dwarf2out.c:26856
>     frame #23: 0x00000001007e4d5f
> lto1`::dwarf2out_function_decl(decl=<unavailable>) at dwarf2out.c:26871
>     frame #24: 0x0000000100851128
> lto1`pass_final::execute(this=<unavailable>, (null)=<unavailable>) const at
> final.c:4695
>     frame #25: 0x0000000100b814af
> lto1`execute_one_pass(pass=0x0000000142d13f50) at passes.c:2483
>     frame #26: 0x0000000100b81b63
> lto1`::execute_pass_list_1(pass=0x0000000142d13f50) at passes.c:2569
>     frame #27: 0x0000000100b81b75
> lto1`::execute_pass_list_1(pass=0x0000000142d13a70) at passes.c:2570
>     frame #28: 0x0000000100b81b75
> lto1`::execute_pass_list_1(pass=0x0000000142d11df0) at passes.c:2570
>     frame #29: 0x0000000100b81ba2
> lto1`execute_pass_list(fn=0x0000000143e2d000, pass=<unavailable>) at
> passes.c:2580
>     frame #30: 0x00000001006eb445
> lto1`cgraph_node::expand(this=0x0000000143c045a0) at cgraphunit.c:2196
>     frame #31: 0x00000001006ec322 lto1`symbol_table::compile() at
> cgraphunit.c:2334
>     frame #32: 0x00000001006ec221
> lto1`symbol_table::compile(this=0x0000000143c05100)
>     frame #33: 0x0000000100030ff0 lto1`lto_main() at lto.c:3390
>     frame #34: 0x0000000100c982ca lto1`::compile_file() at toplev.c:456
>     frame #35: 0x0000000101710faf lto1`toplev::main(int, char**) at
> toplev.c:2176
>     frame #36: 0x0000000101710e7b lto1`toplev::main(this=0x00007fff5fbff68e,
> argc=<unavailable>, argv=<unavailable>)
>     frame #37: 0x0000000101713821 lto1`main(argc=31,
> argv=0x00007fff5fbff6c8) at main.c:39
>     frame #38: 0x00007fff9e132235 libdyld.dylib`start + 1
>     frame #39: 0x00007fff9e132235 libdyld.dylib`start + 1

That I can't reproduce even when backing out all dwarf2out.c changes.

Reply via email to