https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103461
Bug ID: 103461 Summary: [12 Regression] ICE in operator_div::wi_fold 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: asolokha at gmx dot com CC: marxin at gcc dot gnu.org Target Milestone: --- gcc-12.0.0-alpha20211128 snapshot (g:2899d49e3701a4df18a336a680a7095cc99a2229) ICEs when compiling the following testcase w/ -O2: int baz (int c); int bar (int a, int b) { return baz (a && (b / 0)); } int foo (int a, short int b) { return bar (a, b); } % gcc-12.0.0 -O2 -w -c drnnxgu8.c during IPA pass: inline drnnxgu8.c:14:1: internal compiler error: Segmentation fault 14 | } | ^ 0xeaadef crash_signal /var/tmp/portage/sys-devel/gcc-12.0.0_p20211128/work/gcc-12-20211128/gcc/toplev.c:322 0x1d1e040 operator_div::wi_fold(irange&, tree_node*, generic_wide_int<wide_int_storage> const&, generic_wide_int<wide_int_storage> const&, generic_wide_int<wide_int_storage> const&, generic_wide_int<wide_int_storage> const&) const /var/tmp/portage/sys-devel/gcc-12.0.0_p20211128/work/gcc-12-20211128/gcc/range-op.cc:1836 0x1d11cd7 range_operator::wi_fold_in_parts(irange&, tree_node*, generic_wide_int<wide_int_storage> const&, generic_wide_int<wide_int_storage> const&, generic_wide_int<wide_int_storage> const&, generic_wide_int<wide_int_storage> const&) const /var/tmp/portage/sys-devel/gcc-12.0.0_p20211128/work/gcc-12-20211128/gcc/range-op.cc:192 0x1d12634 range_operator::fold_range(irange&, tree_node*, irange const&, irange const&, tree_code) const /var/tmp/portage/sys-devel/gcc-12.0.0_p20211128/work/gcc-12-20211128/gcc/range-op.cc:214 0x116b949 range_fold_binary_expr(int_range<1u>*, tree_code, tree_node*, int_range<1u> const*, int_range<1u> const*) /var/tmp/portage/sys-devel/gcc-12.0.0_p20211128/work/gcc-12-20211128/gcc/tree-vrp.c:1080 0xc2aad5 evaluate_conditions_for_known_args /var/tmp/portage/sys-devel/gcc-12.0.0_p20211128/work/gcc-12-20211128/gcc/ipa-fnsummary.c:511 0xc4732d do_estimate_edge_size(cgraph_edge*) /var/tmp/portage/sys-devel/gcc-12.0.0_p20211128/work/gcc-12-20211128/gcc/ipa-inline-analysis.c:330 0xc48aa7 estimate_edge_size /var/tmp/portage/sys-devel/gcc-12.0.0_p20211128/work/gcc-12-20211128/gcc/ipa-inline.h:79 0xc48aa7 estimate_edge_growth /var/tmp/portage/sys-devel/gcc-12.0.0_p20211128/work/gcc-12-20211128/gcc/ipa-inline.h:100 0xc48aa7 do_estimate_growth_1 /var/tmp/portage/sys-devel/gcc-12.0.0_p20211128/work/gcc-12-20211128/gcc/ipa-inline-analysis.c:429 0xc48b2e cgraph_node::call_for_symbol_and_aliases(bool (*)(cgraph_node*, void*), void*, bool) /var/tmp/portage/sys-devel/gcc-12.0.0_p20211128/work/gcc-12-20211128/gcc/cgraph.h:3411 0xc48b2e estimate_growth(cgraph_node*) /var/tmp/portage/sys-devel/gcc-12.0.0_p20211128/work/gcc-12-20211128/gcc/ipa-inline-analysis.c:467 0x1ca09ef inline_small_functions /var/tmp/portage/sys-devel/gcc-12.0.0_p20211128/work/gcc-12-20211128/gcc/ipa-inline.c:1980 0x1ca09ef ipa_inline /var/tmp/portage/sys-devel/gcc-12.0.0_p20211128/work/gcc-12-20211128/gcc/ipa-inline.c:2743 0x1ca09ef execute /var/tmp/portage/sys-devel/gcc-12.0.0_p20211128/work/gcc-12-20211128/gcc/ipa-inline.c:3142