]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/66814 (ICE: gcc.target/i386/avx512f-klogic-2.c)
authorUros Bizjak <uros@gcc.gnu.org>
Fri, 17 Jul 2015 18:44:33 +0000 (20:44 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Fri, 17 Jul 2015 18:44:33 +0000 (20:44 +0200)
Backport from mainline:
2015-07-10  Uros Bizjak  <ubizjak@gmail.com>

* config/i386/sse.md (movdi_to_sse): Use gen_lowpart
and gen_higpart instead of gen_rtx_SUBREG.
* config/i386/i386.md
(floatdi<X87MODEF:mode>2_i387_with_xmm splitter): Ditto.
(read-modify peephole2): Use gen_lowpart instead of
gen_rtx_SUBREG for operand 5.

2015-06-17  Uros Bizjak  <ubizjak@gmail.com>

Backport from mainline:
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.

testsuite/ChangeLog:

Backport from mainline:
2015-07-09  Uros Bizjak  <ubizjak@gmail.com>

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

From-SVN: r225961

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

index 8dc08bda5184939041c3b63de66e698190f8f609..4a52f55a1b31c8a2c97325f8530da50f3c81b798 100644 (file)
@@ -1,3 +1,26 @@
+2015-06-17  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline:
+       2015-07-10  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/sse.md (movdi_to_sse): Use gen_lowpart
+       and gen_higpart instead of gen_rtx_SUBREG.
+       * config/i386/i386.md
+       (floatdi<X87MODEF:mode>2_i387_with_xmm splitter): Ditto.
+       (read-modify peephole2): Use gen_lowpart instead of
+       gen_rtx_SUBREG for operand 5.
+
+2015-06-17  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline:
+       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-10  Mantas Mikaitis  <Mantas.Mikaitis@arm.com>
 
        * config/arm/arm.h (TARGET_NEON_FP): Remove conditional definition,
@@ -8,8 +31,8 @@
 2015-07-09  Iain Sandoe  <iain@codesourcery.com>
 
        PR target/66523
-       * config/darwin.c (darwin_mark_decl_preserved): Exclude 'L' label names from
-       preservation.
+       * config/darwin.c (darwin_mark_decl_preserved): Exclude 'L' label
+       names from preservation.
 
 2015-07-07  Kaz Kojima  <kkojima@gcc.gnu.org>
 
index b4304438427999371d4bf97242b541f90f3dad09..823d825d875ad7836ae6f8a9761ecda9af2308a5 100644 (file)
   /* The DImode arrived in a pair of integral registers (e.g. %edx:%eax).
      Assemble the 64-bit DImode value in an xmm register.  */
   emit_insn (gen_sse2_loadld (operands[3], CONST0_RTX (V4SImode),
-                             gen_rtx_SUBREG (SImode, operands[1], 0)));
+                             gen_lowpart (SImode, operands[1])));
   emit_insn (gen_sse2_loadld (operands[4], CONST0_RTX (V4SImode),
-                             gen_rtx_SUBREG (SImode, operands[1], 4)));
+                             gen_highpart (SImode, operands[1])));
   emit_insn (gen_vec_interleave_lowv4si (operands[3], operands[3],
-                                        operands[4]));
+                                        operands[4]));
 
   operands[3] = gen_rtx_REG (DImode, REGNO (operands[3]));
 })
 ;; 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))])]
 
   operands[1] = gen_rtx_PLUS (word_mode, base,
                              gen_rtx_MULT (word_mode, index, GEN_INT (scale)));
-  operands[5] = base;
   if (mode != word_mode)
     operands[1] = gen_rtx_SUBREG (mode, operands[1], 0);
+
+  operands[5] = base;
   if (op1mode != word_mode)
-    operands[5] = gen_rtx_SUBREG (op1mode, operands[5], 0);
+    operands[5] = gen_lowpart (op1mode, operands[5]);
+
   operands[0] = dest;
 })
 \f
index 4ba2e6fbbca94327ee4be32e3eafcb73a9000df3..4647cd7320f7c258d59f070864577c34cceb4078 100644 (file)
   (and (match_code "reg")
        (match_test "GENERAL_REG_P (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 8f5120f2ef7340542263f1ba8b157d2fe2e6e2e6..3e35268fc9c8b73fc3bc313789cd5d3e0040e3c0 100644 (file)
       /* The DImode arrived in a pair of integral registers (e.g. %edx:%eax).
         Assemble the 64-bit DImode value in an xmm register.  */
       emit_insn (gen_sse2_loadld (operands[0], CONST0_RTX (V4SImode),
-                                 gen_rtx_SUBREG (SImode, operands[1], 0)));
+                                 gen_lowpart (SImode, operands[1])));
       emit_insn (gen_sse2_loadld (operands[2], CONST0_RTX (V4SImode),
-                                 gen_rtx_SUBREG (SImode, operands[1], 4)));
+                                 gen_highpart (SImode, operands[1])));
       emit_insn (gen_vec_interleave_lowv4si (operands[0], operands[0],
                                             operands[2]));
    }
index 043b4b72821180f983011eaee2262982f66ea860..cbb60c39071477e8ba997d9f212b7bf5dba0bace 100644 (file)
@@ -1,3 +1,11 @@
+2015-06-17  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline:
+       2015-07-09  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/66814
+       * gcc.target/i386/pr66814.c: New test.
+
 2015-07-16  Marek Polacek  <polacek@redhat.com>
 
        2015-07-08  Marek Polacek  <polacek@redhat.com>
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"