[AArch64] Fix some define_insn_and_split conditions
authorRichard Sandiford <richard.sandiford@linaro.org>
Tue, 5 Dec 2017 14:40:37 +0000 (14:40 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 5 Dec 2017 14:40:37 +0000 (14:40 +0000)
The split conditions for aarch64_simd_bsldi_internal and
aarch64_simd_bsldi_alt were:

  "&& GP_REGNUM_P (REGNO (operands[0]))"

But since they (deliberately) can be split before reload, the operand
matched by register_operand can be a SUBREG rather than a REG.  This
triggered a boostrap failure building libgcc with rtl checking enabled.

While checking other define_insn_and_splits for the same thing,
I noticed a couple of SIMD ones were missing the leading "&&",
meaning that they would trigger even without TARGET_SIMD.  That
shouldn't matter in practice, since combine should never end up
generating matching rtl, but...

2017-12-05  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* config/aarch64/aarch64-simd.md (aarch64_simd_bsldi_internal)
(aarch64_simd_bsldi_alt): Check REG_P before GP_REGNUM_P.
(aarch64_cm<optab>di, aarch64_cmtstdi): Add leading "&&" to
split condition.

From-SVN: r255423

gcc/ChangeLog
gcc/config/aarch64/aarch64-simd.md

index 9097671c09aa30af225a0f0dfbbba027b8be3668..87d2b12c7a71c8022de18b334b5ec33cd1f29e13 100644 (file)
@@ -1,3 +1,10 @@
+2017-12-05  Richard Sandiford  <richard.sandiford@linaro.org>
+
+       * config/aarch64/aarch64-simd.md (aarch64_simd_bsldi_internal)
+       (aarch64_simd_bsldi_alt): Check REG_P before GP_REGNUM_P.
+       (aarch64_cm<optab>di, aarch64_cmtstdi): Add leading "&&" to
+       split condition.
+
 2017-12-05  Max Filippov  <jcmvbkbc@gmail.com>
 
        * config/xtensa/xtensa.c (xtensa_asan_shadow_offset): New
index 02f0ff0dd2dcb07ee0f8ab271874e0846b10bfb1..ae71af8334343a749f11db1801554eac01a33cac 100644 (file)
   bit\\t%0.8b, %2.8b, %1.8b
   bif\\t%0.8b, %3.8b, %1.8b
   #"
-  "&& GP_REGNUM_P (REGNO (operands[0]))"
+  "&& REG_P (operands[0]) && GP_REGNUM_P (REGNO (operands[0]))"
   [(match_dup 1) (match_dup 1) (match_dup 2) (match_dup 3)]
 {
   /* Split back to individual operations.  If we're before reload, and
   bit\\t%0.8b, %3.8b, %1.8b
   bif\\t%0.8b, %2.8b, %1.8b
   #"
-  "&& GP_REGNUM_P (REGNO (operands[0]))"
+  "&& REG_P (operands[0]) && GP_REGNUM_P (REGNO (operands[0]))"
   [(match_dup 0) (match_dup 1) (match_dup 2) (match_dup 3)]
 {
   /* Split back to individual operations.  If we're before reload, and
      (clobber (reg:CC CC_REGNUM))]
   "TARGET_SIMD"
   "#"
-  "reload_completed"
+  "&& reload_completed"
   [(set (match_operand:DI 0 "register_operand")
        (neg:DI
          (COMPARISONS:DI
     (clobber (reg:CC CC_REGNUM))]
   "TARGET_SIMD"
   "#"
-  "reload_completed"
+  "&& reload_completed"
   [(set (match_operand:DI 0 "register_operand")
        (neg:DI
          (UCOMPARISONS:DI
     (clobber (reg:CC CC_REGNUM))]
   "TARGET_SIMD"
   "#"
-  "reload_completed"
+  "&& reload_completed"
   [(set (match_operand:DI 0 "register_operand")
        (neg:DI
          (ne:DI