https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117692
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|The VRP pass is introducing |[15 Regression] The VRP |new signed integer overflow |pass is introducing new | |signed integer overflow Last reconfirmed| |2024-11-19 Keywords| |wrong-code Status|UNCONFIRMED |NEW Target Milestone|--- |15.0 Ever confirmed|0 |1 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #1) > Applying pattern match.pd:5600, gimple-match-3.cc:3136 > gimple_simplified to _7 = x_2(D) * 25; > _5 = _7 + 800; > Folded into: _5 = _7 + 800; This pattern: /* ((X /[ex] C1) +- C2) * (C1 * C3) --> (X * C3) +- (C1 * C2 * C3). */ (for op (plus minus) (simplify (mult (convert1? (op (convert2? (exact_div @0 INTEGER_CST@1)) poly_int_tree_p@2)) poly_int_tree_p@3) (with { poly_widest_int factor; } (if (tree_nop_conversion_p (type, TREE_TYPE (@2)) && tree_nop_conversion_p (TREE_TYPE (@0), TREE_TYPE (@2)) && multiple_p (wi::to_poly_widest (@3), wi::to_widest (@1), &factor)) (with { wi::overflow_type overflow; wide_int mul; } (if (types_match (type, TREE_TYPE (@2)) && types_match (TREE_TYPE (@0), TREE_TYPE (@2)) && TREE_CODE (@2) == INTEGER_CST && TREE_CODE (@3) == INTEGER_CST && (mul = wi::mul (wi::to_wide (@2), wi::to_wide (@3), TYPE_SIGN (type), &overflow), !overflow)) (op (mult @0 { wide_int_to_tree (type, factor); }) { wide_int_to_tree (type, mul); }) (with { tree utype = unsigned_type_for (type); } (convert (op (mult (convert:utype @0) { wide_int_to_tree (utype, factor); }) (mult (convert:utype @3) (convert:utype @2))))))))))) Caused by r15-4603-g8d01bc7dc453a4 .