https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69416
--- Comment #7 from Wilco <wdijkstr at arm dot com> --- (In reply to Richard Henderson from comment #5) > Created attachment 37419 [details] > proposed patch > > I'm testing the following, but it does produce correct results > on a spot check of emit-rtl.c:1833. Yes, it looks right now. > We do leave a missed-optimization on the table, in that the > (compare:CC (const_int 29) (const_int 0)) subexpression isn't > optimized. But that's something do addresss in gcc7. We could add patterns to handle some of these special cases, however the tree optimizations should really have removed any redundant comparisons before RTL.