From 0d780006d49eadebc93e0b7ad4cd56a8d0eb3125 Mon Sep 17 00:00:00 2001 From: Kyrylo Tkachov Date: Tue, 12 May 2015 09:15:09 +0000 Subject: [PATCH] [ARM] Fix PR 65955: Do not take REGNO on non-REG operand in movcond_addsi 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 | 6 ++++++ gcc/config/arm/arm.md | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0af90650f64..da57c959524 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-05-12 Kyrylo Tkachov + + 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 * combine.c i(set_nonzero_bits_and_sign_copies): Split code updating diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 3dd5f961933..adbb83fd889 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -9323,7 +9323,7 @@ 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]); -- 2.30.2