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

            Bug ID: 106096
           Summary: [13 regression] ICE building stage 2 libgcc on
                    loongarch64-linux-gnu since r13-911
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xry111 at mengyan1223 dot wang
  Target Milestone: ---

Since r13-911, bootstrapping on loongarch64-linux-gnu is broken because of an
ICE building stage 2 libgcc.

This issue is particularly diffcult to diagnose, due to the reasons:

1. r13-910 and r13-909 does not build, so it's hard to tell which change
"really" triggers the issue.
2. r13-{909,910,911} consist a very large change.
3. GCC even fails to produce a stacktrace on the ICE.
4. It's not reproducible with a cross compiler on x86_64 host, even with ASan
and UBSan.

A backtrace gathered using GDB:

#0  0x0000000000002000 in ?? ()
#1  0x0000000120b2157c in path_range_query::range_defined_in_block (
    this=this@entry=0x121b3bb20, r=..., name=name@entry=0x7ffff55a17a0, 
    bb=bb@entry=0x7ffff5598750) at ../../gcc/gcc/gimple-range-path.cc:354
#2  0x0000000120b21880 in path_range_query::compute_ranges_in_phis (
    this=this@entry=0x121b3bb20, bb=bb@entry=0x7ffff5598750)
    at ../../gcc/gcc/gimple-range-path.cc:400
#3  0x0000000120b21b70 in path_range_query::compute_ranges_in_block (
    this=this@entry=0x121b3bb20, bb=bb@entry=0x7ffff5598750)
    at ../../gcc/gcc/gimple-range-path.cc:448
#4  0x0000000120b225b8 in path_range_query::compute_ranges (this=0x121b3bb20, 
    path=..., imports=<optimized out>)
    at ../../gcc/gcc/gimple-range-path.cc:665
#5  0x0000000120bb1ba0 in back_threader::find_taken_edge_cond (
    this=0x7fffffff6d18, path=..., cond=0x7ffff5775f40)
    at ../../gcc/gcc/tree-ssa-threadbackward.cc:319
#6  0x0000000120bb1d9c in back_threader::find_taken_edge (
    this=this@entry=0x7fffffff6d18, path=...)
    at ../../gcc/gcc/tree-ssa-threadbackward.cc:276
#7  0x0000000120bb2768 in back_threader::maybe_register_path (
    this=this@entry=0x7fffffff6d18)
    at ../../gcc/gcc/tree-ssa-threadbackward.cc:232
#8  0x0000000120bb2f34 in back_threader::find_paths_to_names (
    this=this@entry=0x7fffffff6d18, bb=<optimized out>, 
    interesting=interesting@entry=0x7fffffff6c90)
    at ../../gcc/gcc/tree-ssa-threadbackward.cc:419
#9  0x0000000120bb317c in back_threader::resolve_phi (
    interesting=<optimized out>, phi=<optimized out>, this=<optimized out>)
    at ../../gcc/gcc/tree-ssa-threadbackward.cc:396
#10 back_threader::resolve_phi (this=0x7fffffff6d18, phi=0x7ffff57a0d00, 
    interesting=0x7fffffff6c90) at ../../gcc/gcc/tree-ssa-threadbackward.cc:356
#11 0x0000000120bb2cf0 in back_threader::find_paths_to_names (
    this=this@entry=0x7fffffff6d18, bb=<optimized out>, 
    interesting=interesting@entry=0x7fffffff6c90)
    at ../../gcc/gcc/tree-ssa-threadbackward.cc:444
#12 0x0000000120bb2ddc in back_threader::find_paths_to_names (
    this=this@entry=0x7fffffff6d18, bb=<optimized out>, 
    bb@entry=0x7ffff55986e8, interesting=interesting@entry=0x7fffffff6c90)
    at ../../gcc/gcc/tree-ssa-threadbackward.cc:459
#13 0x0000000120bb3408 in back_threader::find_paths (this=0x7fffffff6d18, 
    bb=0x7ffff55986e8, name=0x7ffff55a1050) at ../../gcc/gcc/bitmap.h:955
#14 0x0000000120bb3620 in back_threader::thread_blocks (
    this=this@entry=0x7fffffff6d18)
    at ../../gcc/gcc/tree-ssa-threadbackward.cc:901
#15 0x0000000120bb3694 in (anonymous namespace)::pass_thread_jumps::execute (
    this=<optimized out>, fun=<optimized out>)
    at ../../gcc/gcc/tree-ssa-threadbackward.cc:1003
#16 0x000000012082a10c in execute_one_pass (pass=pass@entry=0x1219d0550)
    at ../../gcc/gcc/passes.cc:2638
#17 0x000000012082aa68 in execute_pass_list_1 (pass=0x1219d0550)
    at ../../gcc/gcc/passes.cc:2738
#18 0x000000012082aa78 in execute_pass_list_1 (pass=0x1219cded0)
    at ../../gcc/gcc/passes.cc:2739
#19 0x000000012082aad8 in execute_pass_list (fn=<optimized out>, 
    pass=<optimized out>) at ../../gcc/gcc/passes.cc:2749
#20 0x00000001203e1a1c in cgraph_node::expand (this=0x7ffff5609980)
    at ../../gcc/gcc/context.h:48
#21 cgraph_node::expand (this=0x7ffff5609980)
    at ../../gcc/gcc/cgraphunit.cc:1788
#22 0x00000001203e3540 in expand_all_functions ()
    at ../../gcc/gcc/cgraphunit.cc:1999
#23 symbol_table::compile (this=this@entry=0x7ffff548c000)
    at ../../gcc/gcc/cgraphunit.cc:2349
#24 0x00000001203e6be0 in symbol_table::compile (this=0x7ffff548c000)
    at ../../gcc/gcc/cgraphunit.cc:2262
#25 symbol_table::finalize_compilation_unit (this=0x7ffff548c000)
    at ../../gcc/gcc/cgraphunit.cc:2530
#26 0x000000012092d148 in compile_file () at ../../gcc/gcc/toplev.cc:479
#27 0x00000001201ca3d4 in do_compile (no_backend=false)
    at ../../gcc/gcc/toplev.cc:2144
#28 toplev::main (this=this@entry=0x7fffffff7148, argc=<optimized out>, 
    argc@entry=3, argv=<optimized out>, argv@entry=0x7fffffff72d8)
    at ../../gcc/gcc/toplev.cc:2296
#29 0x00000001201cba28 in main (argc=<optimized out>, argv=0x7fffffff72d8)
    at ../../gcc/gcc/main.cc:39

The #0 "0x2000" frame looks very strange, but currently I have no idea why it
appears.

Reply via email to