https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100501
Bug ID: 100501 Summary: ICE: segmentation fault on embedded asm code Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: cnsun at uwaterloo dot ca Target Milestone: --- $ 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.FRQzt2wMfl-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 20210510 (experimental) [master revision :fb3a8fb4a:25f9f35a85ffee808fc1482b14d91176df59751b] (GCC) $ $ gcc-trunk mutant.c mutant.c: In function ‘foo’: mutant.c:5:16: internal compiler error: Segmentation fault 4 | : "m"(({ | ~~ 5 | if (8) | ~~~^~~ 6 | ; | ~ 7 | }))); | ~~ 0xef73e3 crash_signal /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/toplev.c:327 0xbead04 is_gimple_variable /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/gimple-expr.h:84 0xbead04 is_gimple_id /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/gimple-expr.h:95 0xbead04 is_gimple_addressable /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/gimple-expr.h:122 0xbead04 is_gimple_lvalue(tree_node*) /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/gimple-expr.c:595 0xc2742d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/gimplify.c:15038 0xc30a7d gimplify_asm_expr /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/gimplify.c:6506 0xc26765 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/gimplify.c:14416 0xc28fca gimplify_stmt(tree_node**, gimple**) /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/gimplify.c:6877 0xc297fe gimplify_bind_expr /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/gimplify.c:1421 0xc25a33 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/gimplify.c:14284 0xc28fca gimplify_stmt(tree_node**, gimple**) /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/gimplify.c:6877 0xc2a5c3 gimplify_body(tree_node*, bool) /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/gimplify.c:15328 0xc2aa11 gimplify_function_tree(tree_node*) /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/gimplify.c:15482 0xa7e737 cgraph_node::analyze() /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/cgraphunit.c:670 0xa81641 analyze_functions /tmp/tmp.FRQzt2wMfl-gcc-builder/gcc/gcc/cgraphunit.c:1234 0xa82111 symbol_table::finalize_compilation_unit() /tmp/tmp.FRQzt2wMfl-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. $ $ cat mutant.c void foo() { __asm__("" : : "m"(({ if (8) ; }))); } $