https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103513
Bug ID: 103513 Summary: [12 Regression] ICE in evaluate_conditions_for_known_args, at ipa-fnsummary.c:516 with -O2 and above Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com CC: marxin at gcc dot gnu.org Target Milestone: --- Hi all. It seems to be a recent regression issue. $cat small.c #include <stdint.h> uint16_t(a)(); uint16_t(b)(int f, int g) { return f * g; } uint64_t c(); void d() { c(a()); } uint64_t c(int e) { for (;;) if (b(20, -1L == e)) for (;;) ; return 0; } $gcc -c -O2 small.c during IPA pass: inline small.c:12:1: internal compiler error: in evaluate_conditions_for_known_args, at ipa-fnsummary.c:516 12 | } | ^ 0x6c881e evaluate_conditions_for_known_args ../../gcc/ipa-fnsummary.c:516 0xa6133f do_estimate_edge_size(cgraph_edge*) ../../gcc/ipa-inline-analysis.c:330 0xa6247a estimate_edge_size ../../gcc/ipa-inline.h:79 0xa6247a estimate_edge_growth ../../gcc/ipa-inline.h:100 0xa6247a do_estimate_growth_1 ../../gcc/ipa-inline-analysis.c:429 0xa625fd cgraph_node::call_for_symbol_and_aliases(bool (*)(cgraph_node*, void*), void*, bool) ../../gcc/cgraph.h:3411 0xa625fd estimate_growth(cgraph_node*) ../../gcc/ipa-inline-analysis.c:467 0x18d8d6c inline_small_functions ../../gcc/ipa-inline.c:1980 0x18d8d6c ipa_inline ../../gcc/ipa-inline.c:2743 0x18d8d6c execute ../../gcc/ipa-inline.c:3142 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. $gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/home/haoxin/haoxin-data/compilers/gcc/build/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure --prefix=/home/haoxin/haoxin-data/compilers/gcc/build --enable-bootstrap --enable-checking=release --enable-languages=c,c++ --enable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.0.0 20211130 (experimental) (GCC) Can also quickly check here: https://godbolt.org/z/W18G8jn7E Thanks, Haoxin