public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "clyon at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/98198] [11 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in decl_or_type_attrs
Date: Tue, 08 Dec 2020 23:13:49 +0000	[thread overview]
Message-ID: <bug-98198-4-akAEe9JyPK@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98198-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Christophe Lyon <clyon at gcc dot gnu.org> ---
This simple patch avoids the ICE:

diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c
index 1d2ab7c..8847932 100644
--- a/gcc/c-family/c-attribs.c
+++ b/gcc/c-family/c-attribs.c
@@ -767,6 +767,10 @@ decl_or_type_attrs (tree node)
        return attrs;

       tree type = TREE_TYPE (node);
+
+      if (type == error_mark_node)
+       return NULL_TREE;
+
       return TYPE_ATTRIBUTES (type);
     }

  parent reply	other threads:[~2020-12-08 23:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08 12:28 [Bug c/98198] New: " anbu1024.me at gmail dot com
2020-12-08 12:31 ` [Bug c/98198] " rguenth at gcc dot gnu.org
2020-12-08 19:57 ` marxin at gcc dot gnu.org
2020-12-08 20:28 ` clyon at gcc dot gnu.org
2020-12-08 20:31 ` marxin at gcc dot gnu.org
2020-12-08 23:13 ` clyon at gcc dot gnu.org [this message]
2021-01-14 11:02 ` rguenth at gcc dot gnu.org
2021-04-27 11:39 ` [Bug c/98198] [11/12 " jakub at gcc dot gnu.org
2021-07-28  7:05 ` rguenth at gcc dot gnu.org
2022-03-16 23:21 ` cvs-commit at gcc dot gnu.org
2022-03-17 15:15 ` roger at nextmovesoftware dot com

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-98198-4-akAEe9JyPK@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).