https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80659
Bug ID: 80659 Summary: [7 regression] -fsanitize=address evokes ICE in in gimplify_switch_expr Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: jim at meyering dot net Target Milestone: --- The following gets an ICE with gcc 7 (latest from git at git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@247659 138bc75d-0d04-0410-961f-82ee72b054a4), yet gets no ICE with fedora 25's 6.3.1 20161221. FYI, this was minimized using creduce from emacs/src/process.c. $ cat bad.c typedef a; typedef b; struct c { b d } e() { union { struct c f } g; switch (g.f.d) { (a[]){}; h(); } } $ gcc -c -fsanitize=address bad.c bad.c:1:9: warning: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] typedef a; ^ bad.c:2:9: warning: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] typedef b; ^ bad.c:5:1: warning: no semicolon at end of struct or union } e() { ^ bad.c: In function 'e': bad.c:8:3: warning: no semicolon at end of struct or union } g; ^ bad.c:11:5: warning: implicit declaration of function 'h' [-Wimplicit-function-declaration] h(); ^ bad.c:10:10: warning: statement will never be executed [-Wswitch-unreachable] (a[]){}; ^ bad.c:9:3: internal compiler error: in gimplify_switch_expr, at gimplify.c:2301 switch (g.f.d) { ^~~~~~ 0x7c6d6d gimplify_switch_expr /data/users/meyering/x/w/co/gcc/gcc/gimplify.c:2301 0x7c890a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /data/users/meyering/x/w/co/gcc/gcc/gimplify.c:11466 0x7ca888 gimplify_stmt(tree_node**, gimple**) /data/users/meyering/x/w/co/gcc/gcc/gimplify.c:6517 0x7c8e6b gimplify_statement_list /data/users/meyering/x/w/co/gcc/gcc/gimplify.c:1718 0x7c8e6b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /data/users/meyering/x/w/co/gcc/gcc/gimplify.c:11686 0x7ca888 gimplify_stmt(tree_node**, gimple**) /data/users/meyering/x/w/co/gcc/gcc/gimplify.c:6517 0x7cb1c8 gimplify_bind_expr /data/users/meyering/x/w/co/gcc/gcc/gimplify.c:1292 0x7c86ea gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /data/users/meyering/x/w/co/gcc/gcc/gimplify.c:11458 0x7ca888 gimplify_stmt(tree_node**, gimple**) /data/users/meyering/x/w/co/gcc/gcc/gimplify.c:6517 0x7cbbe7 gimplify_body(tree_node*, bool) /data/users/meyering/x/w/co/gcc/gcc/gimplify.c:12455 0x7cbf95 gimplify_function_tree(tree_node*) /data/users/meyering/x/w/co/gcc/gcc/gimplify.c:12613 0x69cf0f cgraph_node::analyze() /data/users/meyering/x/w/co/gcc/gcc/cgraphunit.c:657 0x69f6f7 analyze_functions /data/users/meyering/x/w/co/gcc/gcc/cgraphunit.c:1118 0x6a00d2 symbol_table::finalize_compilation_unit() /data/users/meyering/x/w/co/gcc/gcc/cgraphunit.c:2603 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.