@@ -10522,11 +10522,9 @@
(bswap:HI (match_operand:HI 1 "register_operand" "")))]
"TARGET_CPU_ZARCH"
[(set (match_dup 2) (bswap:SI (match_dup 3)))
- (set (match_dup 2) (lshiftrt:SI (match_dup 2)
- (const_int 16)))
- (set (match_dup 0) (subreg:HI (match_dup 2) 2))]
+ (set (match_dup 2) (lshiftrt:SI (match_dup 2) (const_int 16)))]
{
- operands[2] = gen_reg_rtx (SImode);
+ operands[2] = simplify_gen_subreg (SImode, operands[0], HImode, 0);
operands[3] = simplify_gen_subreg (SImode, operands[1], HImode, 0);
})
new file mode 100644
@@ -0,0 +1,14 @@
+/* PR target/69247 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-march=zEC12" { target s390*-*-* } } */
+
+void foo (short *);
+
+void
+bar (short x, int y)
+{
+ if (y)
+ x = x << 8 | (unsigned short) x >> 8;
+ foo (&x);
+}