re PR target/66814 (ICE: gcc.target/i386/avx512f-klogic-2.c)
authorUros Bizjak <uros@gcc.gnu.org>
Thu, 9 Jul 2015 15:18:44 +0000 (17:18 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 9 Jul 2015 15:18:44 +0000 (17:18 +0200)
PR target/66814
* config/i386/predicates.md (nonimmediate_gr_operand): New predicate.
* config/i386/i386.md (not peephole2): Use nonimmediate_gr_operand.
(varous peephole2s): Use {GENERAL,SSE,MMX}_REGNO_P instead of
{GENERAL_SSE_MMX}_REG_P where appropriate.

testsuite/ChangeLog:

PR target/66814
* gcc.target/i386/pr66814.c: New test.

From-SVN: r225616

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/config/i386/predicates.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr66814.c [new file with mode: 0644]

index 14c55fc6f7005aac71b8474b2bf08ab419377dda..d5f7a25ba445237b935cc2c543a11e3bcc192b80 100644 (file)
@@ -1,3 +1,11 @@
+2015-07-08  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/66814
+       * config/i386/predicates.md (nonimmediate_gr_operand): New predicate.
+       * config/i386/i386.md (not peephole2): Use nonimmediate_gr_operand.
+       (varous peephole2s): Use {GENERAL,SSE,MMX}_REGNO_P instead of
+       {GENERAL_SSE_MMX}_REG_P where appropriate.
+
 2015-07-09  Andrew MacLeod  <amacleod@redhat.com>
 
        * lto-streamer.h: Don't include target.h and alloc-pool.h.
@@ -59,7 +67,7 @@
 2015-07-09  Marek Polacek  <polacek@redhat.com>
 
        PR tree-optimization/66718
-       * Makefile.in (OBJS): Add gimple-laddress.o. 
+       * Makefile.in (OBJS): Add gimple-laddress.o.
        * passes.def: Schedule pass_laddress.
        * timevar.def (DEFTIMEVAR): Add TV_GIMPLE_LADDRESS.
        * tree-pass.h (make_pass_laddress): Declare.
index e7df31dd57c97df2e0cdc0c2c01381a5cdbcdc04..1d43aaffbf4518a64e4898ebb47e1424797479ad 100644 (file)
 ;; lifetime information then.
 
 (define_peephole2
-  [(set (match_operand:SWI124 0 "nonimmediate_operand")
-       (not:SWI124 (match_operand:SWI124 1 "nonimmediate_operand")))]
+  [(set (match_operand:SWI124 0 "nonimmediate_gr_operand")
+       (not:SWI124 (match_operand:SWI124 1 "nonimmediate_gr_operand")))]
   "optimize_insn_for_speed_p ()
    && ((TARGET_NOT_UNPAIRABLE
        && (!MEM_P (operands[0])
                      [(match_dup 0)
                       (match_operand 2 "memory_operand")]))]
   "REGNO (operands[0]) != REGNO (operands[1])
-   && ((MMX_REG_P (operands[0]) && MMX_REG_P (operands[1])) 
-       || (SSE_REG_P (operands[0]) && SSE_REG_P (operands[1])))"
+   && ((MMX_REGNO_P (REGNO (operands[0]))
+        && MMX_REGNO_P (REGNO (operands[1]))) 
+       || (SSE_REGNO_P (REGNO (operands[0]))
+           && SSE_REGNO_P (REGNO (operands[1]))))"
   [(set (match_dup 0) (match_dup 2))
    (set (match_dup 0)
         (match_op_dup 3 [(match_dup 0) (match_dup 1)]))])
        (match_operand 1 "const0_operand"))]
   "GET_MODE_SIZE (GET_MODE (operands[0])) <= UNITS_PER_WORD
    && (! TARGET_USE_MOV0 || optimize_insn_for_size_p ())
-   && GENERAL_REG_P (operands[0])
+   && GENERAL_REGNO_P (REGNO (operands[0]))
    && peep2_regno_dead_p (0, FLAGS_REG)"
   [(parallel [(set (match_dup 0) (const_int 0))
              (clobber (reg:CC FLAGS_REG))])]
   [(set (match_operand:SWI248 0 "register_operand")
        (const_int -1))]
   "(optimize_insn_for_size_p () || TARGET_MOVE_M1_VIA_OR)
+   && GENERAL_REGNO_P (REGNO (operands[0]))
    && peep2_regno_dead_p (0, FLAGS_REG)"
   [(parallel [(set (match_dup 0) (const_int -1))
              (clobber (reg:CC FLAGS_REG))])]
index 2fa5db6074dd9e7ce4ae76bc57fe28321d270e9f..09505fc4f181e6870e4d5fdc02f0248617215c80 100644 (file)
   (and (match_code "reg")
        (match_test "GENERAL_REGNO_P (REGNO (op))")))
 
+;; True if the operand is a nonimmediate operand with GENERAL class register.
+(define_predicate "nonimmediate_gr_operand"
+  (if_then_else (match_code "reg")
+    (match_test "GENERAL_REGNO_P (REGNO (op))")
+    (match_operand 0 "nonimmediate_operand")))
+
 ;; Return true if OP is a register operand other than an i387 fp register.
 (define_predicate "register_and_not_fp_reg_operand"
   (and (match_code "reg")
index ec31dd7cb98b318f23e8d9c8968576805a3f9107..d0c561e231ba35be542b4420a27d01385b24f04c 100644 (file)
@@ -1,3 +1,8 @@
+2015-07-09  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/66814
+       * gcc.target/i386/pr66814.c: New test.
+
 2015-07-09  Szabolcs Nagy  <szabolcs.nagy@arm.com>
 
        * gcc.target/aarch64/fnmul-1.c: Fix whitespace.
diff --git a/gcc/testsuite/gcc.target/i386/pr66814.c b/gcc/testsuite/gcc.target/i386/pr66814.c
new file mode 100644 (file)
index 0000000..4ac9d23
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do compile { target { ia32 } } } */
+/* { dg-options "-march=i586 -mavx512f -O2" } */
+
+#include "avx512f-klogic-2.c"