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

            Bug ID: 120248
           Summary: ICE: Segmentation fault at gcc/toplev.cc:314
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rundongyang22 at m dot fudan.edu.cn
  Target Milestone: ---

Created attachment 61413
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61413&action=edit
The preprocessed source(by using -save-temps)

----------
GCC Version & System Type & Configure Option
$ $CC -v
Using built-in specs.
COLLECT_GCC=/home/liuyu/Desktop/gcc-13/bin/gcc
COLLECT_LTO_WRAPPER=/home/liuyu/Desktop/gcc-13/bin/../libexec/gcc/x86_64-pc-linux-gnu/13.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --disable-multilib --enable-languages=c,c++
--prefix=/home/liuyu/Desktop/bin
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.1.0 (GCC) 

----------
Compiler Output
$ $CC -save-temps ./8763.c
./8763.c: In function ‘sum_in_chunks’:
./8763.c:16:5: warning: implicit declaration of function ‘sum’
[-Wimplicit-function-declaration]
   16 |     sum(&shared_counter, total_sum);
      |     ^~~
./8763.c: At top level:
./8763.c:19:6: warning: conflicting types for ‘sum’; have ‘void(_Atomic
atomic_int *, int)’ {aka ‘void(_Atomic int *, int)’}
   19 | void sum(atomic_int *sum_ref, int chunk_size) {
      |      ^~~
./8763.c:16:5: note: previous implicit declaration of ‘sum’ with type
‘void(_Atomic atomic_int *, int)’ {aka ‘void(_Atomic int *, int)’}
   16 |     sum(&shared_counter, total_sum);
      |     ^~~
./8763.c: In function ‘sum’:
./8763.c:20:5: error: void value not ignored as it ought to be
   20 |     *sum_ref += sum_in_chunks(chunk_size);
      |     ^
./8763.c:20:14: internal compiler error: Segmentation fault
   20 |     *sum_ref += sum_in_chunks(chunk_size);
      |              ^~
0x15f71c7 crash_signal
        ../../gcc/toplev.cc:314
0x7f9b4013e08f ???
       
/build/glibc-FcRMwW/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0xcc6e93 poly_int_tree_p(tree_node const*)
        ../../gcc/tree.h:5449
0x118f5ca gimplify_target_expr
        ../../gcc/gimplify.cc:7114
0x11be60d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.cc:16773
0x118fbbc gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.cc:7219
0x117d35e gimplify_statement_list
        ../../gcc/gimplify.cc:2019
0x11be993 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.cc:16821
0x118fbbc gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.cc:7219
0x118ca9f gimplify_compound_expr
        ../../gcc/gimplify.cc:6412
0x11bc9cf gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.cc:16366
0x118fbbc gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.cc:7219
0x117b13a gimplify_bind_expr
        ../../gcc/gimplify.cc:1430
0x11bd7ec gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.cc:16577
0x118fbbc gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.cc:7219
0x11c17ba gimplify_body(tree_node*, bool)
        ../../gcc/gimplify.cc:17638
0x11c2101 gimplify_function_tree(tree_node*)
        ../../gcc/gimplify.cc:17837
0xefeb6b cgraph_node::analyze()
        ../../gcc/cgraphunit.cc:684
0xf00d22 analyze_functions
        ../../gcc/cgraphunit.cc:1247
0xf042f9 symbol_table::finalize_compilation_unit()
        ../../gcc/cgraphunit.cc:2554
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
  • [Bug c/120248] New: ICE: ... rundongyang22 at m dot fudan.edu.cn via Gcc-bugs

Reply via email to