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

            Bug ID: 85371
           Summary: [8 Regression] Compiling code with -g -flto gives an
                    ICE on darwin after revision r259317
           Product: gcc
           Version: 8.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dominiq at lps dot ens.fr
                CC: marxin at gcc dot gnu.org, rguenth at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-apple-darwin17
            Target: x86_64-apple-darwin17
             Build: x86_64-apple-darwin17

Compiling code with -g -flto gives an ICE on darwin:

(lldb) run -g -flto
/opt/gcc/work/gcc/testsuite/gfortran.dg/allocatable_function_3.f90
Process 8193 launched:
'/opt/gcc/gcc8w/libexec/gcc/x86_64-apple-darwin17.5.0/8.0.1/f951' (x86_64)
 transform_to_spectral_from scram MAIN__ main
Analyzing compilation unit
Process 8193 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=1, address=0x0)
    frame #0: 0x00000001010209c3
f951`darwin_asm_output_dwarf_offset(file=0x00007fffb5933030, size=4,
lab="*Lskeleton_debug_line0", offset=0, base=0x0000000000000000) at
darwin.c:2900
   2897   bool is_for_lto;
   2898   const char *lto_add = "";
   2899 
-> 2900   gcc_checking_assert (base->common.flags & SECTION_NAMED);
   2901   is_for_lto = strncmp (base->named.name, "__GNU_DWARF_LTO,", 16) == 0;
   2902   gcc_checking_assert (is_for_lto
   2903                        || strncmp (base->named.name, "__DWARF,", 8) ==
0);
Target 0: (f951) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=1, address=0x0)
  * frame #0: 0x00000001010209c3
f951`darwin_asm_output_dwarf_offset(file=0x00007fffb5933030, size=4,
lab="*Lskeleton_debug_line0", offset=0, base=0x0000000000000000) at
darwin.c:2900
    frame #1: 0x00000001007671a1 f951`dw2_asm_output_offset(size=<unavailable>,
label=<unavailable>, base=<unavailable>, comment="%s") at dwarf2asm.c:198
    frame #2: 0x00000001007996b8 f951`::output_die(die=0x0000000143ed8000) at
dwarf2out.c:10780
    frame #3: 0x000000010079a420 f951`::output_comp_unit(die=<unavailable>,
output_if_empty=<unavailable>, dwo_id=<unavailable>) at dwarf2out.c:11037
    frame #4: 0x00000001007c41f1
f951`::dwarf2out_early_finish(filename="/opt/gcc/work/gcc/testsuite/gfortran.dg/allocatable_function_3.f90")
at dwarf2out.c:31900
    frame #5: 0x00000001006eb09a
f951`symbol_table::finalize_compilation_unit(this=0x0000000143d25100) at
cgraphunit.c:2713
    frame #6: 0x0000000100c3a3fa f951`::compile_file() at toplev.c:480
    frame #7: 0x00000001012a665b f951`toplev::main(int, char**) at
toplev.c:2132
    frame #8: 0x00000001012a819e f951`main(argc=4, argv=0x00007ffeefbff200) at
main.c:39
    frame #9: 0x00007fff7d651015 libdyld.dylib`start + 1

Reverting revision r259317 returns to normal.

Reply via email to