[ARM] Fix PR 65955: Do not take REGNO on non-REG operand in movcond_addsi
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Tue, 12 May 2015 09:15:09 +0000 (09:15 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Tue, 12 May 2015 09:15:09 +0000 (09:15 +0000)
PR target/65955
* config/arm/arm.md (movcond_addsi): Check that operands[2] is a
REG before taking its REGNO.

From-SVN: r223049

gcc/ChangeLog
gcc/config/arm/arm.md

index 0af90650f647ffe4db7f8649c8de0033969ac7c1..da57c959524e1e3d6ce0cbe830d772ca1351658e 100644 (file)
@@ -1,3 +1,9 @@
+2015-05-12  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       PR target/65955
+       * config/arm/arm.md (movcond_addsi): Check that operands[2] is a
+       REG before taking its REGNO.
+
 2015-05-12  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * combine.c i(set_nonzero_bits_and_sign_copies): Split code updating
index 3dd5f961933f911b91d34c2e1b6d55178d1ca309..adbb83fd8890649c62f1b79e069f2656088adf9e 100644 (file)
     enum rtx_code rc = GET_CODE (operands[5]);
     operands[6] = gen_rtx_REG (mode, CC_REGNUM);
     gcc_assert (!(mode == CCFPmode || mode == CCFPEmode));
-    if (REGNO (operands[2]) != REGNO (operands[0]))
+    if (!REG_P (operands[2]) || REGNO (operands[2]) != REGNO (operands[0]))
       rc = reverse_condition (rc);
     else
       std::swap (operands[1], operands[2]);