https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105219
--- Comment #7 from Tamar Christina <tnfchris at gcc dot gnu.org> --- I have managed to find the commit where this starts failing: commit 61fc5e098e76c9809f35f449a70c9c8d74773d9d (HEAD) Author: Richard Biener <rguent...@suse.de> Date: Fri Feb 18 11:34:52 2022 +0100 tree-optimization/104582 - Simplify vectorizer cost API and fixes This simplifies the vectorizer cost API by providing overloads to add_stmt_cost and record_stmt_cost suitable for scalar stmt and branch stmt costing which do not need information like a vector type or alignment. It also fixes two mistakes where costs for versioning tests were recorded as vector stmt rather than scalar stmt. This is a first patch to simplify the actual fix for PR104582. 2022-02-18 Richard Biener <rguent...@suse.de> PR tree-optimization/104582 * tree-vectorizer.h (add_stmt_cost): New overload. (record_stmt_cost): Likewise. * tree-vect-loop.cc (vect_compute_single_scalar_iteration_cost): Use add_stmt_costs. (vect_get_known_peeling_cost): Use new overloads. (vect_estimate_min_profitable_iters): Likewise. Consistently use scalar_stmt for costing versioning checks. * tree-vect-stmts.cc (record_stmt_cost): New overload. but I think this just exposes the issue. The weird thing is while this does change the cost calculations during vect the final vectorized code is exactly the same out of both version. and indeed there's no change at all in the dumps until cunrolli, which in one version unrolls more than the other, but I think that's just costing difference. So I'm disabling it to continue seeing at which pass there's actually codegen difference between these two commits.