https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124938
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2026-04-21
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
reassoc isn't trying to form the best CSEable sub-expressions, it's mostly by
coincidence if its canonical form allows CSE. There's not always a global
"best" way either, what assocation works best for followup passes might differ
and CSE can inhibit some optimizations as well.
reassoc would need to be split into global analysis and global transform
phases so we can identify common sub-expressions between different
single-use chains and associate accordingly.
I think I have seen duplicate bugreports for this.