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

            Bug ID: 121119
           Summary: ICE on x86_64-linux-gnu: in scan_omp_1_op, at
                    omp-low.cc:4005 with ubsan
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jiangchangwu at smail dot nju.edu.cn
  Target Milestone: ---

Compiler Explorer: https://gcc.godbolt.org/z/TsnohYjse

*******************************************************************************
gcc version:
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/16.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++ --prefix=/home/software/gcc-trunk --enable-coverage
--disable-werror --enable-checking=yes
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 16.0.0 20250613 (experimental) (GCC)

*******************************************************************************
Program:
$ cat mutant.c
int a, b;
void c() {
  int d[a * sizeof(int)];
#pragma omp parallel for
  for (b = 0; b < 0; b++)
    d[0];
}

*******************************************************************************
Command Lines:
$ gcc -fopenmp -fsanitize=undefined mutant.c
during GIMPLE pass: omplower
mutant.c: In function 'c':
mutant.c:6:6: internal compiler error: in scan_omp_1_op, at omp-low.cc:4005
    6 |     d[0];
      |     ~^~~
0x5554b38 internal_error(char const*, ...)
        ../../gcc/gcc/diagnostic-global-context.cc:517
0x54d2d0a fancy_abort(char const*, int, char const*)
        ../../gcc/gcc/diagnostic.cc:1803
0x1d6722f scan_omp_1_op
        ../../gcc/gcc/omp-low.cc:4005
0x297358e walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ../../gcc/gcc/tree.cc:11590
0x18f4424 walk_gimple_op(gimple*, tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
        ../../gcc/gcc/gimple-walk.cc:263
0x18f620a walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
        ../../gcc/gcc/gimple-walk.cc:636
0x18f32bc walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
        ../../gcc/gcc/gimple-walk.cc:51
0x1d692f5 scan_omp
        ../../gcc/gcc/omp-low.cc:4322
0x1d60335 scan_omp_for
        ../../gcc/gcc/omp-low.cc:2960
0x1d689b6 scan_omp_1_stmt
        ../../gcc/gcc/omp-low.cc:4208
0x18f6101 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
        ../../gcc/gcc/gimple-walk.cc:618
0x18f32bc walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
        ../../gcc/gcc/gimple-walk.cc:51
0x18f6367 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
        ../../gcc/gcc/gimple-walk.cc:645
0x18f32bc walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
        ../../gcc/gcc/gimple-walk.cc:51
0x1d692f5 scan_omp
        ../../gcc/gcc/omp-low.cc:4322
0x1d5a7d7 scan_omp_parallel
        ../../gcc/gcc/omp-low.cc:2375
0x1d6854d scan_omp_1_stmt
        ../../gcc/gcc/omp-low.cc:4177
0x18f6101 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
        ../../gcc/gcc/gimple-walk.cc:618
0x18f32bc walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
        ../../gcc/gcc/gimple-walk.cc:51
0x18f6634 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
        ../../gcc/gcc/gimple-walk.cc:681
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.

Reply via email to