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

            Bug ID: 110500
           Summary: gcc: internal compiler error: tree check: expected
                    class 'type', have 'exceptional' (error_mark) in
                    c_parser_omp_clause_allocate
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 141242068 at smail dot nju.edu.cn
  Target Milestone: ---

The program:
```
$ cat small.c
int f, l, ll, r;

void foo(int i1, int i2, int p, int s, int nth, int *q, int ntm) {
#pragma omp distribute parallel for simd \
    private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) \
    if (parallel: i2) if(simd: i1) default(shared) shared(s) reduction(+:r)
num_threads (nth) proc_bind(spread) \
    lastprivate (l) schedule(static, 4) nontemporal(ntm) \
    safelen(8) simdlen(4) aligned(q: 32) order(concurrent) allocate
(omp_default_mem_alloc:f)
  for (int i = 0; i < 64; i++)
    ll++;
}
```

When compile it using gcc-14 with option `-fopenmp-simd -O0`, gcc reports
internal compiler errors as below:
```
<source>: In function 'foo':
<source>:8:70: error: 'omp_default_mem_alloc' undeclared (first use in this
function)
    8 |     safelen(8) simdlen(4) aligned(q: 32) order(concurrent) allocate
(omp_default_mem_alloc:f)
      |                                                                     
^~~~~~~~~~~~~~~~~~~~~
<source>:8:70: note: each undeclared identifier is reported only once for each
function it appears in
<source>:4:9: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in c_parser_omp_clause_allocate, at
c/c-parser.cc:16332
    4 | #pragma omp distribute parallel for simd \
      |         ^~~
0x213097e internal_error(char const*, ...)
        ???:0
0x8947e8 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ???:0
0xa7029d c_parse_file()
        ???:0
0xadf919 c_common_parse_file()
        ???:0
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.
```

This behavior can be verified by visiting the CompilerExplorer:
https://gcc.godbolt.org/z/73436b54M

Reply via email to