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

            Bug ID: 113747
           Summary: ICE: SIGSEGV in non_type_check (tree.h:3822) with
                    -fopenacc --param=openacc-kernels=decompose on invalid
                    code
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 57314
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57314&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fopenacc --param=openacc-kernels=decompose
testcase.C -wrapper valgrind,-q
testcase.C: In function 'void foo()':
testcase.C:6:5: error: 'a' was not declared in this scope
    6 |     a[i] = i;
      |     ^
==6033== Invalid read of size 2
==6033==    at 0x1661F2C: non_type_check (tree.h:3822)
==6033==    by 0x1661F2C: fixup_remapped_decl(tree_node*, omp_context*, bool)
(omp-low.cc:907)
==6033==    by 0x1668AAC: scan_sharing_clauses(tree_node*, omp_context*)
(omp-low.cc:1919)
==6033==    by 0x166A107: scan_omp_target(gomp_target*, omp_context*)
(omp-low.cc:3120)
==6033==    by 0x166AFF1: scan_omp_1_stmt(gimple_stmt_iterator*, bool*,
walk_stmt_info*) (omp-low.cc:4230)
==6033==    by 0x149A9CA: walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*) (gimple-walk.cc:618)
==6033==    by 0x149ABAD: walk_gimple_seq_mod(gimple**, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*) (gimple-walk.cc:51)
==6033==    by 0x149AA81: walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*) (gimple-walk.cc:735)
==6033==    by 0x149ABAD: walk_gimple_seq_mod(gimple**, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*) (gimple-walk.cc:51)
==6033==    by 0x149AAC1: walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*) (gimple-walk.cc:681)
==6033==    by 0x149ABAD: walk_gimple_seq_mod(gimple**, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*) (gimple-walk.cc:51)
==6033==    by 0x166A145: scan_omp (omp-low.cc:4284)
==6033==    by 0x166A145: scan_omp_target(gomp_target*, omp_context*)
(omp-low.cc:3121)
==6033==    by 0x166AEE0: scan_omp_1_stmt(gimple_stmt_iterator*, bool*,
walk_stmt_info*) (omp-low.cc:4234)
==6033==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==6033== 
during GIMPLE pass: omplower
testcase.C:4:9: internal compiler error: Segmentation fault
    4 | #pragma acc kernels
      |         ^~~
0x1816b62 crash_signal
        /repo/gcc-trunk/gcc/toplev.cc:317
$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240203 (experimental) (GCC)

Reply via email to