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

            Bug ID: 126263
           Summary: [OpenMP] ICE with uses_allocators and invalid
                    identifier
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, openmp
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

void f()
{
#pragma omp target parallel \
    uses_allocators(omp_thread_mem_alloc) \
    allocate(omp_thread_mem_alloc: x) private(x)
}

fails with:

foo3.c: In function ‘f’:
foo3.c:4:21: error: ‘omp_thread_mem_alloc’ undeclared (first use in this
function)
    4 |     uses_allocators(omp_thread_mem_alloc) \
      |                     ^~~~~~~~~~~~~~~~~~~~
foo3.c:4:21: note: each undeclared identifier is reported only once for each
function it appears in
foo3.c:3:9: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in c_parser_omp_clause_allocate, at
c/c-parser.cc:19647
    3 | #pragma omp target parallel \
      |         ^~~
0x277e80d internal_error(char const*, ...)
        ../../../repos/gcc/gcc/diagnostic-global-context.cc:787
0x922663 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../../repos/gcc/gcc/tree.cc:9266
0x7de862 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        ../../../repos/gcc/gcc/tree.h:3965
0x7de862 c_parser_omp_clause_allocate
        ../../../repos/gcc/gcc/c/c-parser.cc:19647

Reply via email to