https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120553

--- Comment #5 from Uroš Bizjak <ubizjak at gmail dot com> ---
This patch fixes the non-optimal testcase in Comment #4 for x86_64:

--cut here--
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 40b43cf092a..8eee44756eb 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -26478,8 +26478,8 @@ (define_peephole2
 (define_expand "mov<mode>cc"
   [(set (match_operand:SWIM 0 "register_operand")
        (if_then_else:SWIM (match_operand 1 "comparison_operator")
-                          (match_operand:SWIM 2 "<general_operand>")
-                          (match_operand:SWIM 3 "<general_operand>")))]
+                          (match_operand:SWIM 2 "general_operand")
+                          (match_operand:SWIM 3 "general_operand")))]
   ""
   "if (ix86_expand_int_movcc (operands)) DONE; else FAIL;")

--cut here--

gcc -O2:

        movq    %rdi, %rax
        sarq    $63, %rax
        btsq    $34, %rax
        ret

Reply via email to