@@ -9724,7 +9724,9 @@ (define_insn "*ashl<mode>3_cconly"
&& (TARGET_SHIFT1
|| TARGET_DOUBLE_WITH_ADD)))
&& ix86_match_ccmode (insn, CCGOCmode)
- && ix86_binary_operator_ok (ASHIFT, <MODE>mode, operands)"
+ /* Can't use ix86_binary_operator_ok here, as the scratch
+ operand might be missing. */
+ && !MEM_P (operands[1])"
{
switch (get_attr_type (insn))
{
@@ -10090,7 +10092,9 @@ (define_insn "*<shiftrt_insn><mode>3_cco
|| (operands[2] == const1_rtx
&& TARGET_SHIFT1))
&& ix86_match_ccmode (insn, CCGOCmode)
- && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
+ /* Can't use ix86_binary_operator_ok here, as the scratch
+ operand might be missing. */
+ && !MEM_P (operands[1])"
{
if (operands[2] == const1_rtx
&& (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
@@ -0,0 +1,12 @@
+/* PR target/46088 */
+/* { dg-do compile } */
+/* { dg-options "-Os -fnon-call-exceptions -fpeel-loops" } */
+
+extern void bar (void);
+
+void
+foo (int i)
+{
+ if (i >> 3)
+ bar ();
+}