public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "141242068 at smail dot nju.edu.cn" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/111862] New: 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
Date: Wed, 18 Oct 2023 09:21:08 +0000	[thread overview]
Message-ID: <bug-111862-4@http.gcc.gnu.org/bugzilla/> (raw)

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.
```

             reply	other threads:[~2023-10-18  9:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18  9:21 141242068 at smail dot nju.edu.cn [this message]
2023-10-18 19:02 ` [Bug c/111862] " pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-111862-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).