aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Peryt <sebastian.peryt@intel.com>2018-04-25 14:39:57 +0200
committerSebastian Peryt <speryt@gcc.gnu.org>2018-04-25 14:39:57 +0200
commitbe3830f845753a70a38599f3d963a5cbbedcd306 (patch)
tree930decb1a8f708e20b9c065559a8687032b8cc6c
parentd3e6cab2e0c397527a4d7a06d52af04fd4a8c11a (diff)
downloadgcc-be3830f845753a70a38599f3d963a5cbbedcd306.zip
gcc-be3830f845753a70a38599f3d963a5cbbedcd306.tar.gz
gcc-be3830f845753a70a38599f3d963a5cbbedcd306.tar.bz2
re PR target/85473 (internal compiler error: in emit_move_insn, at expr.c:3722)
2018-04-25 Sebastian Peryt <sebastian.peryt@intel.com> gcc/ChangeLog: PR target/85473 * config/i386/i386.c (ix86_expand_builtin): Change memory operand to XI, extend p0 to Pmode. * config/i386/i386.md: Change unspec volatile and operand 1 mode to XI, change operand 0 mode to P. gcc/testsuite/ChangeLog: PR target/85473 * gcc.target/i386/pr85473-1.c: New test. * gcc.target/i386/pr85473-2.c: New test. From-SVN: r259648
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/i386/i386.c11
-rw-r--r--gcc/config/i386/i386.md4
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.target/i386/pr85473-1.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/pr85473-2.c7
6 files changed, 45 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6ea0aaa..e65ab7b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2018-04-25 Sebastian Peryt <sebastian.peryt@intel.com>
+
+ PR target/85473
+ * config/i386/i386.c (ix86_expand_builtin): Change memory
+ operand to XI, extend p0 to Pmode.
+ * config/i386/i386.md: Change unspec volatile and operand
+ 1 mode to XI, change operand 0 mode to P.
+
2018-04-25 Chung-Ju Wu <jasonwucj@gmail.com>
* config/nds32/nds32-predicates.c (nds32_can_use_bclr_p): Mask with
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index a3c3870..6a2141e 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -37147,11 +37147,14 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
arg1 = CALL_EXPR_ARG (exp, 1);
op0 = expand_normal (arg0);
op1 = expand_normal (arg1);
- mode0 = (TARGET_64BIT ? DImode : SImode);
- op0 = force_reg (mode0, op0);
- if (!memory_operand (op1, mode0))
- op1 = gen_rtx_MEM (mode0, op1);
+ op0 = ix86_zero_extend_to_Pmode (op0);
+ if (!address_operand (op1, VOIDmode))
+ {
+ op1 = convert_memory_address (Pmode, op1);
+ op1 = copy_addr_to_reg (op1);
+ }
+ op1 = gen_rtx_MEM (XImode, op1);
insn = (TARGET_64BIT
? gen_movdir64b_di (op0, op1)
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index a134ca8..ad9ccf9 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -20697,8 +20697,8 @@
[(set_attr "type" "other")])
(define_insn "movdir64b_<mode>"
- [(unspec_volatile:SWI48[(match_operand:SWI48 0 "register_operand" "r")
- (match_operand:SWI48 1 "memory_operand")]
+ [(unspec_volatile:XI[(match_operand:P 0 "register_operand" "r")
+ (match_operand:XI 1 "memory_operand")]
UNSPECV_MOVDIR64B)]
"TARGET_MOVDIR64B"
"movdir64b\t{%1, %0|%0, %1}"
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7a955a6..a62a9cb 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2018-04-25 Sebastian Peryt <sebastian.peryt@intel.com>
+
+ PR target/85473
+ * gcc.target/i386/pr85473-1.c: New test.
+ * gcc.target/i386/pr85473-2.c: New test.
+
2018-04-25 Nathan Sidwell <nathan@acm.org>
Jakub Jelinek <jakub@redhat.com>
diff --git a/gcc/testsuite/gcc.target/i386/pr85473-1.c b/gcc/testsuite/gcc.target/i386/pr85473-1.c
new file mode 100644
index 0000000..d0c04d3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr85473-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-require-effective-target maybe_x32 } */
+/* { dg-options "-O2 -mx32 -maddress-mode=short -mmovdir64b" } */
+/* { dg-final { scan-assembler "movdir64b\[ \\t\]" } } */
+
+unsigned int w[5] __attribute__((aligned(64)));
+
+void
+foo ()
+{
+
+ unsigned int array[] = {1, 2, 3, 4, 5};
+ __builtin_ia32_movdir64b(w, array);
+}
+
diff --git a/gcc/testsuite/gcc.target/i386/pr85473-2.c b/gcc/testsuite/gcc.target/i386/pr85473-2.c
new file mode 100644
index 0000000..a325d04
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr85473-2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-require-effective-target maybe_x32 } */
+/* { dg-options "-O2 -mx32 -maddress-mode=long -mmovdir64b" } */
+/* { dg-final { scan-assembler "movdir64b\[ \\t\]" } } */
+
+#include "pr85473-1.c"
+