https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77499
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Target Milestone|--- |7.0 Summary|Regression after |[7 Regression] Regression |code-hoisting, due to |after code-hoisting, due to |combine pass failing to |combine pass failing to |evaluate known value range |evaluate known value range --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- on x86 the code is if-converted which might help combine (though there is nothing to combine on x86). It looks like nonzero_bits never looks at sets of REGs and thus can only work on expressions. Code hoisting generally makes sub-expressions no longer single-use (in this case the x >> 1) which means they won't appear as part of a larger expression (and combine doesn't consider re-combining them unless in some very specific circumstances). In this case r111:SI is used multiple times. It seems with thumb the code is only if-converted after reload for some reason.