https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106506
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2022-08-10 Status|UNCONFIRMED |ASSIGNED Ever confirmed|0 |1 Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 53431 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53431&action=edit gcc13-pr106506.patch Those 2 checks were just trying to be careful, the (phires & 1) == phires and variants it is folded to of course make only sense for the -1/0/1/2 result spaceship, for -1/0/1 one can just use comparisons of phires. We only floating point spaceship if nans aren't honored, so the 2 case is ignored, and if it is, with Aldy's changes we can simplify the 2 case away from the phi but the (phires & 1) == phires stayed. It is safe to treat the phires comparison as phires >= 0 even then.