S/390: PR target/79240: Fix assertion in s390_extzv_shift_ok.
authorDominik Vogt <vogt@linux.vnet.ibm.com>
Mon, 30 Jan 2017 09:54:58 +0000 (09:54 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Mon, 30 Jan 2017 09:54:58 +0000 (09:54 +0000)
2017-01-30  Dominik Vogt  <vogt@linux.vnet.ibm.com>

PR target/79240
* config/s390/s390.md ("*r<noxa>sbg_<mode>_srl_bitmask")
("*r<noxa>sbg_<mode>_sll_bitmask")
("*extzv_<mode>_srl<clobbercc_or_nocc>")
("*extzv_<mode>_sll<clobbercc_or_nocc>"):
Use contiguous_bitmask_nowrap_operand.

2017-01-30  Dominik Vogt  <vogt@linux.vnet.ibm.com>

PR target/79240
* gcc.target/s390/pr79240.c: New test.

From-SVN: r245022

gcc/ChangeLog
gcc/config/s390/s390.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/s390/pr79240.c [new file with mode: 0644]

index 535647aeb2ca4637b62cb8e357408534f57e41d9..30b078582dc1dd9625587f4a14103f2efd82c98c 100644 (file)
@@ -1,3 +1,12 @@
+2017-01-30  Dominik Vogt  <vogt@linux.vnet.ibm.com>
+
+       PR target/79240
+       * config/s390/s390.md ("*r<noxa>sbg_<mode>_srl_bitmask")
+       ("*r<noxa>sbg_<mode>_sll_bitmask")
+       ("*extzv_<mode>_srl<clobbercc_or_nocc>")
+       ("*extzv_<mode>_sll<clobbercc_or_nocc>"):
+       Use contiguous_bitmask_nowrap_operand.
+
 2017-01-29  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        PR target/79268
index 31351756a50039cef90ba5629d94314be562594c..e47c2e90a65692934d90218fd5d8b37195fefd61 100644 (file)
            (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
            (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
        (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" "")))]
   "<z10_or_zEC12_cond>
    /* Note that even for the SImode pattern, the rotate is always DImode.  */
    && s390_extzv_shift_ok (<bitsize>, -INTVAL (operands[2]),
        (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" "")))]
   "<z10_or_zEC12_cond>
    && s390_extzv_shift_ok (<bitsize>, INTVAL (operands[2]),
                           INTVAL (operands[3]))"
index 84b45441fdbd7d72884f65ae16218a9777dd0b46..f93fc0c29f78106ae7db707af43419c64f8e8006 100644 (file)
@@ -1,3 +1,8 @@
+2017-01-30  Dominik Vogt  <vogt@linux.vnet.ibm.com>
+
+       PR target/79240
+       * gcc.target/s390/pr79240.c: New test.
+
 2017-01-29  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        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 (file)
index 0000000..bd8f72f
--- /dev/null
@@ -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;
+}