This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][ARM]Fix addsi3_compare_op2 pattern.
- From: Renlin Li <renlin dot li at arm dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>, Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- Date: Thu, 12 Nov 2015 09:29:17 +0000
- Subject: [PATCH][ARM]Fix addsi3_compare_op2 pattern.
- Authentication-results: sourceware.org; auth=none
Hi all,
This is a simply patch to adjust the assembly output for
addsi3_compare_op2 rtx pattern in ARM backend.
According to the constraints, it's the second alternative which allows
the second operand to be a constant.
The original pattern will trigger an ICE when the third alternative is
chosen, and trying to output a constant while the second operand is a
register.
This is triggered by my experimental backend changes. branch 5, 4.9 all
have this problem.
arm-none-linux-gnueabihf bootstrap Okay, arm-none-eabi regression test Okay.
Okay to commit into trunk and backport to branch 5 and 4.9?
Regards,
Renlin Li
gcc/ChangeLog:
2015-11-12 Renlin Li <renlin.li@arm.com>
* config/arm/arm.md (addsi3_compare_op2): Make the order of
assembly pattern consistent with constraint order.
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 8ebb1bf..73c3088 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -747,8 +747,8 @@
"TARGET_32BIT"
"@
adds%?\\t%0, %1, %2
- adds%?\\t%0, %1, %2
- subs%?\\t%0, %1, #%n2"
+ subs%?\\t%0, %1, #%n2
+ adds%?\\t%0, %1, %2"
[(set_attr "conds" "set")
(set_attr "type" "alus_imm,alus_imm,alus_sreg")]
)