http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48774
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-02 17:31:17 UTC --- Created attachment 24169 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24169 gcc47-pr48774.patch Untested fix. The additional condition could be changed to just CCCmode check, or on the other side have: || !(TARGET_USE_BT || optimize_function_for_size_p (cfun)) in as well. Or *bt<mode> would need to be represented in RTL in some different way, where the setting of Carry is natural to the operation and couldn't be confused with testqi.