https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100786
Bug ID: 100786 Summary: ICE: in fold_convert_loc, at fold-const.c:2429 Product: gcc Version: tree-ssa 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.tVhv2eaPzV-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 20210526 (experimental) [master revision :21638bbbf:1fd76b24306ed4df4cf9e797d900699ed59ce7f7] (GCC) $ cat mutant.c const double a = 0; extern b __attribute__((alias("a"))); inc() { b++; } $ gcc-trunk mutant.c mutant.c:2:8: warning: type defaults to ‘int’ in declaration of ‘b’ [-Wimplicit-int] 2 | extern b __attribute__((alias("a"))); | ^ mutant.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 3 | inc() { b++; } | ^~~ mutant.c: In function ‘inc’: mutant.c:3:10: internal compiler error: in fold_convert_loc, at fold-const.c:2429 3 | inc() { b++; } | ~^~ 0x6bfba3 fold_convert_loc(unsigned int, tree_node*, tree_node*) /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/fold-const.c:2429 0xc085b7 fold_stmt_1 /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimple-fold.c:6251 0xc3cbf2 gimplify_modify_expr /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimplify.c:6000 0xc2c1f8 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimplify.c:13965 0xc2fb2a gimplify_stmt(tree_node**, gimple**) /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimplify.c:6883 0xc31ce6 gimplify_and_add(tree_node*, gimple**) /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimplify.c:492 0xc31ce6 internal_get_tmp_var /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimplify.c:645 0xc2b777 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimplify.c:14954 0xc2bf91 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimplify.c:14720 0xc3ca07 gimplify_modify_expr /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimplify.c:5824 0xc2c1f8 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimplify.c:13965 0xc2fb2a gimplify_stmt(tree_node**, gimple**) /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimplify.c:6883 0xc3035e gimplify_bind_expr /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimplify.c:1424 0xc2c593 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimplify.c:14166 0xc2fb2a gimplify_stmt(tree_node**, gimple**) /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimplify.c:6883 0xc31123 gimplify_body(tree_node*, bool) /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimplify.c:15210 0xc31571 gimplify_function_tree(tree_node*) /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/gimplify.c:15364 0xa842c7 cgraph_node::analyze() /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/cgraphunit.c:670 0xa871f1 analyze_functions /tmp/tmp.tVhv2eaPzV-gcc-builder/gcc/gcc/cgraphunit.c:1234 0xa87cc1 symbol_table::finalize_compilation_unit() /tmp/tmp.tVhv2eaPzV-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.