[AArch64] PR 68102: Check that operand is REG before checking the REGNO in mov-immedi...
authorktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Oct 2015 18:32:37 +0000 (18:32 +0000)
committerktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229455 138bc75d-0d04-0410-961f-82ee72b054a4

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

index ac7bba4..3c436f4 100644 (file)
@@ -1,5 +1,12 @@
 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):
        Handle floating point inner modes properly.
 
index baa97fd..7c052ca 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 230581c..78603a3 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;
+}