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

            Bug ID: 100993
           Summary: ICE with -O2: Segmentation fault,
                    cgraph_update_edges_for_call_stmt(gimple*, tree_node*,
                    gimple*)
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cnsun at uwaterloo dot ca
  Target Milestone: ---

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/configure
--enable-languages=c,c++,lto --enable-checking-yes --enable-multiarch
--prefix=/scratch/software/gcc-trunk --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210609 (experimental) [master revision
:c23bc3c72:87f9ac937d6cfd81cbbe0a43518ba10781888d7c] (GCC)

$ cat mutant.c
__builtin_acc_on_device(dev) { return __builtin_acc_on_device(dev); }

$ gcc-trunk -O2 mutant.c
mutant.c:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    1 | __builtin_acc_on_device(dev) { return __builtin_acc_on_device(dev); }
      | ^~~~~~~~~~~~~~~~~~~~~~~
mutant.c: In function ‘__builtin_acc_on_device’:
mutant.c:1:1: warning: type of ‘dev’ defaults to ‘int’ [-Wimplicit-int]
during IPA pass: inline
In function ‘__builtin_acc_on_device’:
cc1: internal compiler error: Segmentation fault
0xf091b3 crash_signal
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/toplev.c:327
0xa826d0 cgraph_update_edges_for_call_stmt(gimple*, tree_node*, gimple*)
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/cgraph.c:1729
0xf8bdcd fold_marked_statements
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/tree-inline.c:5384
0xf9bf87 tree_function_versioning(tree_node*, tree_node*, vec<ipa_replace_map*,
va_gc, vl_embed>*, ipa_param_adjustments*, bool, bitmap_head*,
basic_block_def*)
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/tree-inline.c:6457
0xcc1f1b save_inline_function_body
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/ipa-inline-transform.c:658
0xcc1f1b inline_transform(cgraph_node*)
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/ipa-inline-transform.c:750
0xe1c8f4 execute_one_ipa_transform_pass
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/passes.c:2290
0xe1c8f4 execute_all_ipa_transforms(bool)
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/passes.c:2337
0xa89639 cgraph_node::expand()
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/cgraphunit.c:1821
0xa8aa5f expand_all_functions
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/cgraphunit.c:1992
0xa8aa5f symbol_table::compile()
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/cgraphunit.c:2356
0xa8d95b symbol_table::compile()
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/cgraphunit.c:2269
0xa8d95b symbol_table::finalize_compilation_unit()
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/cgraphunit.c:2537
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.

Reply via email to