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/101478] New: ICE on invalid code: recompute_tree_invariant_for_addr_expr Date: Fri, 16 Jul 2021 20:42:37 +0000 [thread overview] Message-ID: <bug-101478-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101478 Bug ID: 101478 Summary: ICE on invalid code: recompute_tree_invariant_for_addr_expr Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: cnsun at uwaterloo dot ca Target Milestone: --- This might be a duplicate of PR 84244. But that issue has a fortran test program. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/configure --enable-languages=c,c++,lto --enable-checking-yes --enable-multiarch --prefix=/scratch/software/gcc-trunk --disable-bootstrap Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.0.0 20210716 (experimental) [master revision :2c298de71:d97d71a1989e9ee8e1b8563b351c42b7732da108] (GCC) $ cat mutant.c struct obj { int n; list l; } main() { obj o = (struct obj *)((char *)({ 1; }) - (char *)&((struct obj *)0)->l); } $ gcc-trunk mutant.c mutant.c:3:3: error: unknown type name ‘list’ 3 | list l; | ^~~~ mutant.c: In function ‘main’: mutant.c:5:3: error: unknown type name ‘obj’; use ‘struct’ keyword to refer to the type 5 | obj o = (struct obj *)((char *)({ 1; }) - (char *)&((struct obj *)0)->l); | ^~~ | struct mutant.c:5:26: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 5 | obj o = (struct obj *)((char *)({ 1; }) - (char *)&((struct obj *)0)->l); | ^ mutant.c:5:11: warning: initialization of ‘int’ from ‘struct obj *’ makes integer from pointer without a cast [-Wint-conversion] 5 | obj o = (struct obj *)((char *)({ 1; }) - (char *)&((struct obj *)0)->l); | ^ mutant.c:5:11: internal compiler error: in recompute_tree_invariant_for_addr_expr, at tree.c:4795 5 | obj o = (struct obj *)((char *)({ 1; }) - (char *)&((struct obj *)0)->l); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 0x7d4928 recompute_tree_invariant_for_addr_expr(tree_node*) /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/tree.c:4795 0xc58424 gimplify_addr_expr /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:6239 0xc4ae1f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:14257 0xc4a55b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:14515 0xc4a55b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:14515 0xc56f4f gimplify_modify_expr /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:5807 0xc4a2e0 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:14210 0xc4dcca gimplify_stmt(tree_node**, gimple**) /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:6869 0xc51057 gimplify_and_add(tree_node*, gimple**) /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:494 0xc51057 gimplify_decl_expr /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:1831 0xc4ae06 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:14407 0xc4dcca gimplify_stmt(tree_node**, gimple**) /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:6869 0xc4e4fe gimplify_bind_expr /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:1426 0xc4b4dc gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:14411 0xc4dcca gimplify_stmt(tree_node**, gimple**) /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:6869 0xc4f2f3 gimplify_body(tree_node*, bool) /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:15443 0xc4f741 gimplify_function_tree(tree_node*) /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/gimplify.c:15597 0xaa2467 cgraph_node::analyze() /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/cgraphunit.c:670 0xaa5341 analyze_functions /tmp/tmp.K5cVOXlrxH-gcc-builder/gcc/gcc/cgraphunit.c:1234 0xaa5e21 symbol_table::finalize_compilation_unit() /tmp/tmp.K5cVOXlrxH-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.
next reply other threads:[~2021-07-16 20:42 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-16 20:42 cnsun at uwaterloo dot ca [this message] 2021-08-22 4:42 ` [Bug c/101478] [10/11/12 Regression] " pinskia at gcc dot gnu.org 2022-01-09 0:36 ` pinskia at gcc dot gnu.org 2022-01-20 12:47 ` rguenth at gcc dot gnu.org 2022-06-28 10:45 ` [Bug c/101478] [10/11/12/13 " jakub at gcc dot gnu.org 2023-07-07 10:40 ` [Bug c/101478] [11/12/13/14 " rguenth at gcc dot gnu.org 2024-03-23 20:14 ` [Bug c/101478] [11/12/13/14 Regression] ICE with statement expression and offsetof like expression 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-101478-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: linkBe 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).