From 9060e33505bda4d9d9301e26f7962d347cf79c9d Mon Sep 17 00:00:00 2001 From: Andreas Krebbel Date: Wed, 13 Jan 2016 11:59:29 +0000 Subject: S/390: PR69247: Fix bswap hi splitter. gcc/ChangeLog: 2016-01-13 Andreas Krebbel PR target/69247 * config/s390/s390.md (bswaphi splitter): Use simplify_gen_subreg. gcc/testsuite/ChangeLog: 2016-01-13 Jakub Jelinek PR target/69247 * gcc.dg/pr69247.c: New test. From-SVN: r232318 --- gcc/ChangeLog | 5 +++++ gcc/config/s390/s390.md | 6 ++---- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr69247.c | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr69247.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e7e3601..ab61dff 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-01-13 Andreas Krebbel + + PR target/69247 + * config/s390/s390.md (bswaphi splitter): Use simplify_gen_subreg. + 2016-01-13 Richard Biener PR tree-optimization/69242 diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index d6097c1..3e340c3 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -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); }) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4568a636..59596d0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-01-13 Jakub Jelinek + + PR target/69247 + * gcc.dg/pr69247.c: New test. + 2016-01-13 Richard Biener PR tree-optimization/69242 diff --git a/gcc/testsuite/gcc.dg/pr69247.c b/gcc/testsuite/gcc.dg/pr69247.c new file mode 100644 index 0000000..b7406e6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr69247.c @@ -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); +} -- cgit v1.1