https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103254
Bug ID: 103254 Summary: [12 Regression] Compile time hog in compare_values_warnv Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: compile-time-hog Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com Target Milestone: --- gcc-12.0.0-alpha20111107 snapshot (g:962ff7d2849e1fa6a1fe0535aa2dec5c2b9a32a6) takes indefinite time to compile the following testcase w/ -O3: short int i; void foo (void) { for (i = 1; i < 2; i += 4) { int j; for (j = 0; j < 5; j += 4) { int k; for (k = 0; k < 68; k += 4) { i &= j; j &= i; } } } } % timeout 10 gcc-12.0.0 -O3 -c mgyelpiv.c zsh: exit 124 timeout 10 gcc-12.0.0 -O3 -c mgyelpiv.c Several top entries from perf top output: 8.03% cc1 [.] wide_int_to_tree_1 5.93% cc1 [.] compare_values_warnv 5.38% cc1 [.] irange::irange_union 4.72% cc1 [.] irange::varying_compatible_p 4.34% cc1 [.] wi::to_wide 3.23% cc1 [.] irange::irange_intersect 3.12% cc1 [.] tree_int_cst_compare 3.07% cc1 [.] wi::force_to_size 2.76% cc1 [.] useless_type_conversion_p 2.67% cc1 [.] irange::lower_bound 2.38% cc1 [.] irange::set_varying 2.31% cc1 [.] wi::shifted_mask 2.17% cc1 [.] get_single_symbol 1.91% cc1 [.] int_cst_hasher::hash 1.86% cc1 [.] irange::verify_range 1.84% cc1 [.] wi::min_value 1.84% cc1 [.] irange::irange_set_anti_range 1.63% cc1 [.] wi::lts_p<generic_wide_int<wide_int_ref_storage<false, false> >, generic_wide_int<wide_int_ref_storage<false, f 1.46% cc1 [.] operand_compare::operand_equal_p 1.37% cc1 [.] operator_cast::fold_pair 1.35% cc1 [.] gori_compute::compute_operand_range