From ab4be5d1be0007a26492a98d268075d43a01b1f0 Mon Sep 17 00:00:00 2001 From: Dominik Vogt Date: Mon, 30 Jan 2017 09:54:58 +0000 Subject: [PATCH] S/390: PR target/79240: Fix assertion in s390_extzv_shift_ok. 2017-01-30 Dominik Vogt PR target/79240 * config/s390/s390.md ("*rsbg__srl_bitmask") ("*rsbg__sll_bitmask") ("*extzv__srl") ("*extzv__sll"): Use contiguous_bitmask_nowrap_operand. 2017-01-30 Dominik Vogt PR target/79240 * gcc.target/s390/pr79240.c: New test. From-SVN: r245022 --- gcc/ChangeLog | 9 +++++++++ gcc/config/s390/s390.md | 8 ++++---- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/s390/pr79240.c | 11 +++++++++++ 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.target/s390/pr79240.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 535647aeb2c..30b078582dc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2017-01-30 Dominik Vogt + + PR target/79240 + * config/s390/s390.md ("*rsbg__srl_bitmask") + ("*rsbg__sll_bitmask") + ("*extzv__srl") + ("*extzv__sll"): + Use contiguous_bitmask_nowrap_operand. + 2017-01-29 Bill Schmidt PR target/79268 diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 31351756a50..e47c2e90a65 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -4127,7 +4127,7 @@ (lshiftrt:GPR (match_operand:GPR 1 "nonimmediate_operand" "d") (match_operand:GPR 3 "nonzero_shift_count_operand" "")) - (match_operand:GPR 2 "contiguous_bitmask_operand" "")) + (match_operand:GPR 2 "contiguous_bitmask_nowrap_operand" "")) (match_operand:GPR 4 "nonimmediate_operand" "0"))) (clobber (reg:CC CC_REGNUM))] "TARGET_Z10 @@ -4143,7 +4143,7 @@ (ashift:GPR (match_operand:GPR 1 "nonimmediate_operand" "d") (match_operand:GPR 3 "nonzero_shift_count_operand" "")) - (match_operand:GPR 2 "contiguous_bitmask_operand" "")) + (match_operand:GPR 2 "contiguous_bitmask_nowrap_operand" "")) (match_operand:GPR 4 "nonimmediate_operand" "0"))) (clobber (reg:CC CC_REGNUM))] "TARGET_Z10 @@ -7191,7 +7191,7 @@ (and:GPR (lshiftrt:GPR (match_operand:GPR 1 "register_operand" "d") (match_operand:GPR 2 "nonzero_shift_count_operand" "")) - (match_operand:GPR 3 "contiguous_bitmask_operand" "")))] + (match_operand:GPR 3 "contiguous_bitmask_nowrap_operand" "")))] " /* Note that even for the SImode pattern, the rotate is always DImode. */ && s390_extzv_shift_ok (, -INTVAL (operands[2]), @@ -7205,7 +7205,7 @@ (and:GPR (ashift:GPR (match_operand:GPR 1 "register_operand" "d") (match_operand:GPR 2 "nonzero_shift_count_operand" "")) - (match_operand:GPR 3 "contiguous_bitmask_operand" "")))] + (match_operand:GPR 3 "contiguous_bitmask_nowrap_operand" "")))] " && s390_extzv_shift_ok (, INTVAL (operands[2]), INTVAL (operands[3]))" diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 84b45441fdb..f93fc0c29f7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-01-30 Dominik Vogt + + PR target/79240 + * gcc.target/s390/pr79240.c: New test. + 2017-01-29 Bill Schmidt PR target/79268 diff --git a/gcc/testsuite/gcc.target/s390/pr79240.c b/gcc/testsuite/gcc.target/s390/pr79240.c new file mode 100644 index 00000000000..bd8f72f3f80 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/pr79240.c @@ -0,0 +1,11 @@ +/* This testcase checks that s390_extzv_shift_ok does not cause an assertion + failure. */ + +/* { dg-do compile } */ +/* { dg-options "-w -march=z196 -mtune=zEC12 -m64 -mzarch -O2" } */ + +int +foo (int a) +{ + return sizeof (int) * a + 16 - a * sizeof (int) % 16; +} -- 2.30.2