This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][ARM] Fix bug in add patterns due to commutativity modifier
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Kyrylo Tkachov <Kyrylo dot Tkachov at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>
- Date: Thu, 25 Jul 2013 17:15:20 +0100
- Subject: Re: [PATCH][ARM] Fix bug in add patterns due to commutativity modifier
- References: <001401ce894b$f9879d50$ec96d7f0$ at email@example.com>
On 25/07/13 16:31, Kyrylo Tkachov wrote:
Some of the new alternatives added to the add patterns in arm.md recently to
accommodate 16-bit encodings have the output template "add %0, %2" if operand
1 is the same register as the destination (operand 0). This would be fine,
except that the two source operands for the add patterns are commutative, i.e.
they have the '%' modifier that tells the optimisers that they can swap
operands 1 and 2 without consequence. This will lead to incorrect code if we
are not printing out operand 1.
This patch fixes that oversight. Gas is smart enough to use the 16-bit
encoding when it sees one of the sources being the same as the destination.
Bootstrapped on arm-linux-gnueabihf and regtested on arm-none-eabi.
Ok for trunk?
2013-07-25 Kyrylo Tkachov <firstname.lastname@example.org>
* config/arm/arm.md (arm_addsi3,
addsi3_carryin_<optab> and addsi3_carryin_alt2_<optab>):
Correct output template.