https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110873
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-08-03 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- GCC 13 had: ``` Registering value_relation (h_29 == h_13) (bb10) at h_29 = PHI <h_13(9)> Loops range found for h_29: [irange] unsigned char [5, 5] NONZERO 0x5 and calculated range :[irange] unsigned char [0, 5] NONZERO 0x7 Global Exported: h_29 = [irange] unsigned char [5, 5] NONZERO 0x5 Folding PHI node: h_29 = PHI <h_13(9)> Queued PHI for removal. Folds to: 5 Folding statement: if (h_29 <= 4) gimple_simplified to if (0 != 0) gimple_simplified to if (0 != 0) Folded into: if (0 != 0) `` While trunk does: ``` redicate evaluates to: DON'T KNOW Not folded Registering value_relation (h_29 == h_13) (bb10) at h_29 = PHI <h_13(9)> Global Exported: h_29 = [irange] unsigned char [0, 5] MASK 0xfe VALUE 0xe7 Folding PHI node: h_29 = PHI <h_13(9)> No folding possible Folding statement: if (h_29 <= 4) Visiting conditional with predicate: if (h_29 <= 4) With known ranges h_29: [irange] unsigned char [0, 5] MASK 0xfe VALUE 0xe7 Predicate evaluates to: DON'T KNOW Simplified relational if (h_29 <= 4) into if (h_29 != 5) Folded into: if (h_29 != 5) ``` Which totally misses that h_29 was just 5.