Thank you guys, Updated patch is attached. Test fails wihout and passing with the fix. ChangeLog entry: 2011-10-20 Kirill Yukhin PR target/50766 * config/i386/i386.md (bmi_bextr_): Update register/ memory operand order. (bmi2_bzhi_3): Ditto. (bmi2_pdep_3): Ditto. (bmi2_pext_3): Ditto. testsuite/ChangeLog entry: 2011-10-20 Kirill Yukhin PR target/50766 * gcc.target/i386/pr50766.c: New test. Could you please have a look? Thanks, K