https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111324
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Keywords| |missed-optimization Last reconfirmed| |2023-09-07 Severity|normal |enhancement CC| |pinskia at gcc dot gnu.org --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. So using the local range in this case is ok. There might be only a few times we don't want to use it though in match. Here is a testcase where we should just change it into "return x;" but don't yet: ``` typedef unsigned int INT; INT foo (INT x, INT y) { if (x > 100 || y > 100) return x; return (x * y) / y; } ``` Note clang is able to change it though.