From 1869bdda0d4dc8e828e56497d5b9cc3103f9a244 Mon Sep 17 00:00:00 2001 From: Renlin Li Date: Wed, 2 Dec 2015 14:06:31 +0000 Subject: [PATCH] [PR67383][ARM][4.9]Backport of "Allow any register for DImode values in Thumb2" This partially fix PR67383. It allows the reload more flexibility to choose spilling pseudo registers. gcc/ChangeLog: 2015-12-02 Renlin Li Backport from mainline. 2014-04-22 Ramana Radhakrishnan * config/arm/arm.c (arm_hard_regno_mode_ok): Loosen restrictions on core registers for DImode values in Thumb2. From-SVN: r231177 --- gcc/ChangeLog | 8 ++++++++ gcc/config/arm/arm.c | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ee1d24075cdd..f0e5d6f245e9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2015-12-02 Renlin Li + + Backport from mainline. + 2014-04-22 Ramana Radhakrishnan + + * config/arm/arm.c (arm_hard_regno_mode_ok): Loosen + restrictions on core registers for DImode values in Thumb2. + 2015-11-25 Vladimir Makarov PR rtl-optimization/67954 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 8ba60608a8fc..d9028a1aed6b 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -22624,12 +22624,19 @@ arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode) } /* We allow almost any value to be stored in the general registers. - Restrict doubleword quantities to even register pairs so that we can - use ldrd. Do not allow very large Neon structure opaque modes in - general registers; they would use too many. */ + Restrict doubleword quantities to even register pairs in ARM state + so that we can use ldrd. Do not allow very large Neon structure + opaque modes in general registers; they would use too many. */ if (regno <= LAST_ARM_REGNUM) - return !(TARGET_LDRD && GET_MODE_SIZE (mode) > 4 && (regno & 1) != 0) - && ARM_NUM_REGS (mode) <= 4; + { + if (ARM_NUM_REGS (mode) > 4) + return FALSE; + + if (TARGET_THUMB2) + return TRUE; + + return !(TARGET_LDRD && GET_MODE_SIZE (mode) > 4 && (regno & 1) != 0); + } if (regno == FRAME_POINTER_REGNUM || regno == ARG_POINTER_REGNUM) -- 2.47.2