This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, ARM] Fix for PR52294: Out-of-range branch in Thumb2 code


PR52294 is a case where we generate a cbz instruction that ends up
trying to reach too far.  The reason for this is that we calculate the
size of some instructions as being 2 bytes when in reality they take 4.

The problem in this instance is that a peephole to shorten

lsl reg, reg, reg

into

lsls reg, reg, reg

Failed to observe that the first two registers have to be identical
(unlike lsls reg, reg, #const) or the result will be no shorter than the
original.

Fixed thusly:

	PR target/52294
	* thumb2.md (thumb2_shiftsi3_short): Split register and 	
	immediate shifts.  For register shifts tie operands 0 and 1.
	(peephole2 for above): Check that register-controlled shifts
	have suitably tied operands.

R.

Attachment: shiftreg.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]