@@ -672,6 +672,12 @@ (define_predicate "register_no_elim_operand"
{
if (SUBREG_P (op))
op = SUBREG_REG (op);
+
+ /* Before reload, we can allow (SUBREG (MEM...)) as a register operand
+ because it is guaranteed to be reloaded into one. */
+ if (MEM_P (op))
+ return true;
+
return !(op == arg_pointer_rtx
|| op == frame_pointer_rtx
|| IN_RANGE (REGNO (op),
@@ -685,6 +691,7 @@ (define_predicate "index_register_operand"
{
if (SUBREG_P (op))
op = SUBREG_REG (op);
+
if (reload_completed)
return REG_OK_FOR_INDEX_STRICT_P (op);
else
new file mode 100644
@@ -0,0 +1,18 @@
+/* PR target/105927 */
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O1 -fno-tree-dce -mtune=k6-3 -msse2" } */
+
+typedef _Float16 __attribute__((__vector_size__(4))) U;
+typedef _Float16 __attribute__((__vector_size__(2))) V;
+typedef short __attribute__((__vector_size__(4))) W;
+V v;
+U u;
+
+extern void bar(W i);
+
+void
+foo(void)
+{
+ U x = __builtin_shufflevector(v, u, 2, 0);
+ bar(x >= 0);
+}