public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/104506] [12 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.cc:87 on invalid symbol redeclaration
Date: Fri, 11 Feb 2022 22:57:45 +0000	[thread overview]
Message-ID: <bug-104506-4-Ve5dgJa4vH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104506-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The NOP_EXPR comes from:

(gdb) up
#1  0x0000000000b99a72 in c_process_expr_stmt (loc=266752, expr=<parm_decl
0x7ffff7ff6080 x>) at
/home/apinski/src/upstream-gcc/gcc/gcc/c/c-typeck.cc:11356
11356         expr = build1 (NOP_EXPR, TREE_TYPE (expr), expr);
(gdb) l
11351
11352     /* If the expression is not of a type to which we cannot assign a
line
11353        number, wrap the thing in a no-op NOP_EXPR.  */
11354     if (DECL_P (expr) || CONSTANT_CLASS_P (expr))
11355       {
11356         expr = build1 (NOP_EXPR, TREE_TYPE (expr), expr);
11357         SET_EXPR_LOCATION (expr, loc);
11358       }


But if you had a cast to void, it would come from somewhere else.


The strip is:
      /* Strip away as many useless type conversions as possible
         at the toplevel.  */
      STRIP_USELESS_TYPE_CONVERSION (*expr_p);


Now do we want to add a check inside STRIP_USELESS_TYPE_CONVERSION for
error_mark_node, I am still deciding.

  parent reply	other threads:[~2022-02-11 22:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 16:49 [Bug c/104506] New: " zsojka at seznam dot cz
2022-02-11 18:22 ` [Bug c/104506] " pinskia at gcc dot gnu.org
2022-02-11 18:24 ` pinskia at gcc dot gnu.org
2022-02-11 21:48 ` pinskia at gcc dot gnu.org
2022-02-11 21:50 ` pinskia at gcc dot gnu.org
2022-02-11 22:57 ` pinskia at gcc dot gnu.org [this message]
2022-02-11 23:01 ` pinskia at gcc dot gnu.org
2022-02-14  8:32 ` rguenth at gcc dot gnu.org
2022-02-14 11:11 ` jakub at gcc dot gnu.org
2022-02-18 21:41 ` pinskia at gcc dot gnu.org
2022-02-21  9:06 ` cvs-commit at gcc dot gnu.org
2022-02-21  9:07 ` 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-104506-4-Ve5dgJa4vH@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).