public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cnsun at uwaterloo dot ca" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/100532] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
Date: Tue, 11 May 2021 16:10:14 +0000	[thread overview]
Message-ID: <bug-100532-4-v15wmMNFyw@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100532-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Chengnian Sun <cnsun at uwaterloo dot ca> ---
Another duplicate.


$ cat mutant.c
void *memcpy(void[], const void *, __SIZE_TYPE__);
f(x) {
  if (f)
    memcpy(x, x, x);
}

$ gcc-trunk  mutant.c
mutant.c:1:18: error: declaration of type name as array of voids
    1 | void *memcpy(void[], const void *, __SIZE_TYPE__);
      |                  ^
mutant.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    2 | f(x) {
      | ^
mutant.c: In function ‘f’:
mutant.c:2:1: warning: type of ‘x’ defaults to ‘int’ [-Wimplicit-int]
mutant.c:4:12: error: type of formal parameter 1 is incomplete
    4 |     memcpy(x, x, x);
      |            ^
mutant.c:4:15: warning: passing argument 2 of ‘memcpy’ makes pointer from
integer without a cast [-Wint-conversion]
    4 |     memcpy(x, x, x);
      |               ^
      |               |
      |               int
mutant.c:1:22: note: expected ‘const void *’ but argument is of type ‘int’
    1 | void *memcpy(void[], const void *, __SIZE_TYPE__);
      |                      ^~~~~~~~~~~~
mutant.c:4:5: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
    4 |     memcpy(x, x, x);
      |     ^~~~~~
0x7bce07 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/tree.c:8724
0x6cb4a3 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/tree.h:3479
0x6cb4a3 useless_type_conversion_p(tree_node*, tree_node*)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimple-expr.c:259
0xc2fc77 types_compatible_p
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimple-expr.h:67
0xc2fc77 gimplify_addr_expr
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:6246
0xc25d93 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:14130
0xc34d59 gimplify_call_expr
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:3446
0xc25d73 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:14055
0xc28f6a gimplify_stmt(tree_node**, gimple**)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:6877
0xc2d4cb gimplify_cond_expr
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:4264
0xc25a77 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:14040
0xc28f6a gimplify_stmt(tree_node**, gimple**)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:6877
0xc2979e gimplify_bind_expr
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:1421
0xc259d3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:14284
0xc28f6a gimplify_stmt(tree_node**, gimple**)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:6877
0xc2a563 gimplify_body(tree_node*, bool)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:15328
0xc2a9b1 gimplify_function_tree(tree_node*)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:15482
0xa7e707 cgraph_node::analyze()
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/cgraphunit.c:670
0xa81611 analyze_functions
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/cgraphunit.c:1234
0xa820e1 symbol_table::finalize_compilation_unit()
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/cgraphunit.c:2508
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

  reply	other threads:[~2021-05-11 16:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 16:06 [Bug c/100532] New: " cnsun at uwaterloo dot ca
2021-05-11 16:10 ` cnsun at uwaterloo dot ca [this message]
2021-05-12  9:29 ` [Bug c/100532] " marxin at gcc dot gnu.org
2021-08-22  4:39 ` [Bug c/100532] [12 Regression] " pinskia at gcc dot gnu.org
2021-08-22  4:40 ` pinskia at gcc dot gnu.org
2021-08-22 13:51 ` [Bug c/100532] " hjl.tools at gmail dot com
2022-05-06  8:30 ` jakub at gcc dot gnu.org
2022-11-15 19:45 ` pinskia at gcc dot gnu.org
2023-04-23  3:01 ` pinskia at gcc dot gnu.org
2023-10-18  3:25 ` pinskia at gcc dot gnu.org
2023-10-19  5:30 ` pinskia at gcc dot gnu.org
2023-10-19 15:39 ` pinskia at gcc dot gnu.org
2023-10-19 16:51 ` cvs-commit at gcc dot gnu.org
2023-10-19 16:52 ` 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-100532-4-v15wmMNFyw@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).