https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108292
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Roger Sayle from comment #8) > Created attachment 54195 [details] > Roger's proposed patch > > Here's my proposed patch (or something close to it, it's still bootstrapping > and regression testing). The goal is to capture the original comparison (at > the top of the BB), and avoid/ignore the actual comparison that we may have > converted to. > Sorry again to the inconvenience. Please let me know what you think. I don't like that much (of course, Uros is the maintainer so his call). But, I think we should avoid bundling the code generation changes (the dropping of ct or cf checks for negate_cc_compare_p; if that is a win, it should be proven separately but it isn't clear if it is) and the patch just causes further dead variables which the current code already has many. What is the point of orig_code when code is already dead except for this newly added REG_EQUAL note? Why can't just code contain it? As for the floating point stuff, yes, the - 1 would be an option, but perhaps should be used only if we need to reverse floating point comparison? If we introduce a bool for swap_ct_cf, then it seems pointless to also actually swap ct/cf and recompute diff in all the spots, just set swap_ct_cf and swap/recompute diff only if the bool is set and we need to look at ct/cf/diff.