[AArch64] PR 68102: Check that operand is REG before checking the REGNO in mov-immedi...
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Tue, 27 Oct 2015 18:32:37 +0000 (18:32 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Tue, 27 Oct 2015 18:32:37 +0000 (18:32 +0000)
PR target/68102
* config/aarch64/aarch64.md (*movsi_aarch64): Check that
operands[0] is a reg before taking its REGNO in split condition.
(*movdi_aarch64): Likewise.

* gcc.target/aarch64/pr68102_1.c: New test.

From-SVN: r229455

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

index ac7bba496ae93562b7e8de108822577f864c53e3..3c436f4e27220897f201f2e29593918aaa05cffb 100644 (file)
@@ -1,3 +1,10 @@
+2015-10-27  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       PR target/68102
+       * config/aarch64/aarch64.md (*movsi_aarch64): Check that
+       operands[0] is a reg before taking its REGNO in split condition.
+       (*movdi_aarch64): Likewise.
+
 2015-10-27  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * config/aarch64/aarch64.c (aarch64_output_simd_mov_immediate):
index baa97fdf250b9d96c84123dd6cf0c4fd1bf2efb5..7c052ca34ac0f644bb56f7fe985ec93ebdfc69e5 100644 (file)
    fmov\\t%w0, %s1
    fmov\\t%s0, %s1"
    "CONST_INT_P (operands[1]) && !aarch64_move_imm (INTVAL (operands[1]), SImode)
-    && GP_REGNUM_P (REGNO (operands[0]))"
+    && REG_P (operands[0]) && GP_REGNUM_P (REGNO (operands[0]))"
    [(const_int 0)]
    "{
        aarch64_expand_mov_immediate (operands[0], operands[1]);
    fmov\\t%d0, %d1
    movi\\t%d0, %1"
    "(CONST_INT_P (operands[1]) && !aarch64_move_imm (INTVAL (operands[1]), DImode))
-    && GP_REGNUM_P (REGNO (operands[0]))"
+    && REG_P (operands[0]) && GP_REGNUM_P (REGNO (operands[0]))"
    [(const_int 0)]
    "{
        aarch64_expand_mov_immediate (operands[0], operands[1]);
index 230581c6e9ad357eb7701e22967027587a44055c..78603a31d59084beddc2daae3c9978722bc01997 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-27  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       PR target/68102
+       * gcc.target/aarch64/pr68102_1.c: New test.
+
 2015-01-27  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/67933
diff --git a/gcc/testsuite/gcc.target/aarch64/pr68102_1.c b/gcc/testsuite/gcc.target/aarch64/pr68102_1.c
new file mode 100644 (file)
index 0000000..3193b27
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef __Float64x1_t float64x1_t;
+
+typedef long int64_t;
+
+extern int64_t bar (float64x1_t f);
+
+int
+foo (void)
+{
+  float64x1_t f = { 3.14159265358979311599796346854 };
+  int64_t c = 0x400921FB54442D18;
+  int64_t r;
+  r = bar (f);
+  return r == c;
+}