[GAS][ARM][PR20827]Fix gas error for two register form instruction (pre-UAL syntax).

Renlin Li renlin.li@foss.arm.com
Thu Nov 17 10:22:00 GMT 2016


Hi all,

Previously, I had a patch to emit warning for PC used in data processing instructions
with register-shifted register operand.
https://sourceware.org/ml/binutils/2016-10/msg00073.html

It will assert if any operand is not presented before the shifted register operand.
However, there is a relaxation of requirements I had missed in pre-UAL syntax.
If the destination register is the same as the first operand, a two register
form of the instruction can be used.

so the following two instruction are the same.
1) add r5, r4, lsl r0
2) add r5, r5, r4, lsl r0

Although, the preferred form for ALU instructions specifies three registers,
even if the destination register is the same as the first operand.
If unified syntax is selected, gas will give error for instruction 1) during operand parsing.

This patch fixes the bug. binutils arm-none-eabi regression test checked Okay.
Okay to check in the change?

The previous change is not in the 2.27 release branch.
So the 2.27 shouldn't have the problem.

Regards,
Renlin


gas/ChangeLog:

2016-11-17  Renlin Li  <renlin.li@arm.com>

	* config/tc-arm.c (encode_arm_shift): Don't assert for operands not
	presented.
	* testsuite/gas/arm/add-shift-two.d: New.
	* testsuite/gas/arm/add-shift-two.s: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmp(5).diff
Type: text/x-patch
Size: 1513 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20161117/57a317ea/attachment.bin>


More information about the Binutils mailing list