https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51838
--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> --- (In reply to Hongtao.liu from comment #2) > The interest thing is when i remove addti3 and ashlti3 from i386.md, GCC > generates optimal code. Yes, we had this situation with <logic>_doubleword instructions, and it looks the same cure can also be applied to arithmetic and shift doubleword patterns. In the past, the middle-end was not able to emit operations with carry, so we were forced to implement doubleword arithmetic/shifts it as it is currently done. If this limitation was lifted in the meantime, then removing interfering patterns is the sure way to go. There is a small complication with DImode patterns, which have to be present for i686 to perform STV conversion, and we have to check for special values (see for example "*anddi3_doubleword) and explicitly handle them.