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

            Bug ID: 111862
           Summary: GCC: internal compiler error: tree check: expected
                    class 'type', have 'exceptional' (error_mark) in
                    c_parser_omp_clause_reduction, at c/c-parser.cc:16234
           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 bug triggering program, compile it with option `-O1 -fopenmp-simd`, gcc
crashes:
```
union S {};
void baz (void *);

int const_1 = 0;
void f (void)
{
  struct S s;
  int i;
  #pragma omp taskloop simd reduction(+:s)
  for (i = const_1; i < 1; i++)
    baz (&s);
}
```

Compiler Explorer: https://godbolt.org/z/361KvMv41

This bug seems similar to #110500, maybe it was not fully fixed in #110500?

Stack dump:
```
<source>: In function 'f':
<source>:7:10: error: 'S' defined as wrong kind of tag
    7 |   struct S s;
      |          ^
<source>:7:12: error: storage size of 's' isn't known
    7 |   struct S s;
      |            ^
<source>:9:11: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in c_parser_omp_clause_reduction, at
c/c-parser.cc:16234
    9 |   #pragma omp taskloop simd reduction(+:s)
      |           ^~~
0x231210e internal_error(char const*, ...)
        ???:0
0x8a8b5c tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ???:0
0xaa6d8d c_parse_file()
        ???:0
0xb1a0c9 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.
```
  • [Bug c/111862] New: GCC: in... 141242068 at smail dot nju.edu.cn via Gcc-bugs

Reply via email to