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

            Bug ID: 124683
           Summary: [omp] has_device_addr tree check fail in
                    c_finish_omp_clauses
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For this reduced omp C code:

void zoo() {
  short *xpp;
#pragma omp target has_device_addr(xpp[1])
  ;
}

Recent clang likes it:

cvise $ clang -fopenmp -c bug1194.c
cvise $ 

but recent gcc trunk doesn't:

cvise $ ~/gcc/results/bin/gcc -fopenmp -c bug1194.c
bug1194.c: In function ‘zoo’:
bug1194.c:3:9: internal compiler error: tree check: expected tree that contains
‘decl minimal’ structure, have ‘indirect_ref’ in c_finish_omp_clauses, at
c/c-typeck.cc:18038
    3 | #pragma omp target has_device_addr(xpp[1])
      |         ^~~

This problem goes back to sometime before gcc 12.1.0.

Compiler is

cvise $ ~/gcc/results/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/home/dcb42/gcc/results/bin/gcc
COLLECT_LTO_WRAPPER=/home/dcb42/gcc/results.20260325.ubsan/libexec/gcc/x86_64-pc-linux-gnu/16.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../trunk/configure
--prefix=/home/dcb42/gcc/results.20260325.ubsan --disable-bootstrap
--disable-doc --disable-multilib --with-build-config=bootstrap-ubsan
--with-pkgversion=476d61a8cb28b627 --enable-checking=yes
--enable-languages=c,c++,fortran
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.1 20260325 (experimental) (476d61a8cb28b627) 
cvise $

Reply via email to