From: Kyrylo Tkachov Date: Tue, 27 Oct 2015 18:32:37 +0000 (+0000) Subject: [AArch64] PR 68102: Check that operand is REG before checking the REGNO in mov-immedi... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7263fa9ff190a311c6fefc4aafb374437d1020ae;p=gcc.git [AArch64] PR 68102: Check that operand is REG before checking the REGNO in mov-immediate splitters 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ac7bba496ae..3c436f4e272 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-10-27 Kyrylo Tkachov + + 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 * config/aarch64/aarch64.c (aarch64_output_simd_mov_immediate): diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index baa97fdf250..7c052ca34ac 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -995,7 +995,7 @@ 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]); @@ -1028,7 +1028,7 @@ 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]); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 230581c6e9a..78603a31d59 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-10-27 Kyrylo Tkachov + + PR target/68102 + * gcc.target/aarch64/pr68102_1.c: New test. + 2015-01-27 Paul Thomas 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 index 00000000000..3193b276aa3 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr68102_1.c @@ -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; +}