re PR target/69512 (ICE when using avx with i586)
authorUros Bizjak <uros@gcc.gnu.org>
Wed, 27 Jan 2016 17:08:00 +0000 (18:08 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 27 Jan 2016 17:08:00 +0000 (18:08 +0100)
2016-01-27  Uros Bizjak  <ubizjak@gmail.com>

PR target/69512
* config/i386/i386.md (*zext<mode>_doubleword_and): New pattern.
(*zext<mode>_doubleword): Disable for TARGET_ZERO_EXTEND_WITH_AND.

testsuite/ChangeLog:

2016-01-27  Uros Bizjak  <ubizjak@gmail.com>

PR target/69512
* gcc.target/i386/pr69512.c: New test.

From-SVN: r232885

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

index e5f1701..ea59088 100644 (file)
@@ -1,3 +1,9 @@
+2016-01-27  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/69512
+       * config/i386/i386.md (*zext<mode>_doubleword_and): New pattern.
+       (*zext<mode>_doubleword): Disable for TARGET_ZERO_EXTEND_WITH_AND.
+
 2016-01-27  Thomas Klausner  <wiz@NetBSD.org>
 
        PR target/68380
index f16b42a..79c5f1a 100644 (file)
   [(set_attr "type" "imovx")
    (set_attr "mode" "SI")])
 
+(define_insn_and_split "*zext<mode>_doubleword_and"
+  [(set (match_operand:DI 0 "register_operand" "=&<r>")
+       (zero_extend:DI (match_operand:SWI12 1 "nonimmediate_operand" "<r>m")))]
+  "!TARGET_64BIT && TARGET_STV && TARGET_SSE2
+   && TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun)"
+  "#"
+  "&& reload_completed && GENERAL_REG_P (operands[0])"
+  [(set (match_dup 2) (const_int 0))]
+{
+  split_double_mode (DImode, &operands[0], 1, &operands[0], &operands[2]);
+
+  emit_move_insn (operands[0], const0_rtx);
+
+  gcc_assert (!TARGET_PARTIAL_REG_STALL);
+  emit_insn (gen_movstrict<mode>
+            (gen_lowpart (<MODE>mode, operands[0]), operands[1]));
+})
+
 (define_insn_and_split "*zext<mode>_doubleword"
   [(set (match_operand:DI 0 "register_operand" "=r")
        (zero_extend:DI (match_operand:SWI12 1 "nonimmediate_operand" "<r>m")))]
-  "!TARGET_64BIT && TARGET_STV && TARGET_SSE2"
+  "!TARGET_64BIT && TARGET_STV && TARGET_SSE2
+   && !(TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun))"
   "#"
   "&& reload_completed && GENERAL_REG_P (operands[0])"
   [(set (match_dup 0) (zero_extend:SI (match_dup 1)))
index 94659a2..a7b0452 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-27  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/69512
+       * gcc.target/i386/pr69512.c: New test.
+
 2016-01-27  Rainer Emrich  <rainer@emrich-ebersheim.de>
 
        PR ada/69488
@@ -55,7 +60,7 @@
        * gcc.dg/autopar/pr69110.c: New test.
 
 2016-01-26  Abderrazek Zaafrani  <a.zaafrani@samsung.com>
-            Sebastian Pop  <s.pop@samsung.com>
+           Sebastian Pop  <s.pop@samsung.com>
 
        * gcc.dg/graphite/isl-ast-op-select.c: New.
 
diff --git a/gcc/testsuite/gcc.target/i386/pr69512.c b/gcc/testsuite/gcc.target/i386/pr69512.c
new file mode 100644 (file)
index 0000000..4147e66
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-march=i586 -mavx -O2" } */
+
+extern double s1[];
+extern double s2[];
+extern long long e[];
+
+void test (void)
+{
+  int i;
+
+  for (i = 0; i < 2; i++)
+    e[i] = !__builtin_isunordered(s1[i], s2[i]) && s1[i] != s2[i] ? -1 : 0;
+}