https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112994
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #1) > It might be a regression but we are still missing a pattern for: > int n,m; > void test(int a, int b){ > m=(a*4)/(a*2); > } Yep, and we're seeing that first because when value-numbering _3 = n.0_2 + b_8; we're turning that into a_5(D) * 4 via x+x -> x*2 (good) (x*2)*2 -> x*4 ("bad", doesn't realize the other use of x*2 keeps it live) we're then missing said pattern.