[Patch, AVR]: Fix PR49487 (ICE for wrong rotate scratch)

Georg-Johann Lay avr@gjlay.de
Thu Jul 14 07:54:00 GMT 2011


http://gcc.gnu.org/ml/gcc-patches/2011-07/msg01036.html

Georg-Johann Lay wrote:
> This is a patch to fix PR49487.

Forgot to attach it. Here it is.

> As Denis will be off-line for some time, it'd be great if
> a global reviewer would review it.  It appears that he is
> the only AVR maintainer who approves patches.
> 
> The reason for the ICE is as explained in the PR:
> 
> Rotate pattern use "X" as constraint for an operand which is
> used as scratch.  However, the operand is a match_operand
> and not a match_scratch.
> 
> Because the scratch is not needed in all situations, I choose
> to use match_scratch instead of match_operand and not to fix
> the constraints.  Fixing constraints would lead to superfluous
> allocation of register if no scratch was needed.
> 
> Tested with 2 FAILs less: gcc.c-torture/compile/pr46883.c
> ICEs without this patch and passes with it.
> 
> The test case in the PR passes, too. That test case
> passes also the current unpatched 4.7, but it's obvious that
> the constraint/operand combination is a bug.
> 
> Ok to commit and back-port to 4.6?
> 
> Johann
> 
> 	PR target/49487
> 	* config/avr/avr.md (rotl<mode>3): Generate SCRATCH instead
> 	of REG.
> 	(*rotw<mode>): Use const_int_operand for operands2.
> 	Use match_scatch for operands3.
> 	(*rotb<mode>): Ditto
> 	* config/avr/avr.c (avr_rotate_bytes): Treat SCRATCH.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr49487.diff
Type: text/x-patch
Size: 3988 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110714/23a5c0f5/attachment.bin>


More information about the Gcc-patches mailing list