Bug 111862 - 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
Summary: GCC: internal compiler error: tree check: expected class 'type', have 'except...
Status: RESOLVED DUPLICATE of bug 110500
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 14.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-on-invalid-code, openmp
Depends on:
Blocks:
 
Reported: 2023-10-18 09:21 UTC by wierton
Modified: 2023-10-18 19:02 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wierton 2023-10-18 09:21:08 UTC
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.
```
Comment 1 Andrew Pinski 2023-10-18 19:02:25 UTC
Dup of bug 110500 (which was not fixed yet; just a patch was posted to the bug report for someone to finish up).

*** This bug has been marked as a duplicate of bug 110500 ***