This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] h8300.c: Fix compute_a_rotate_length.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 26 Jun 2003 13:50:18 -0400 (EDT)
- Subject: [patch] h8300.c: Fix compute_a_rotate_length.
Hi,
Attached is a patch to fix compute_a_rotate_length.
Before comitting the previous H8 patch, I thought I looked at the
result of regression testing, but I apparently didn't. :-(
The problem is that compute_a_rotate_length tries to get the amount of
a rotation by XEXP (src, 1), where src is really a REG. It should
just be operands[2].
Tested on h8300 port. Committed.
Kazu Hirata
2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.c (compute_a_rotate_length): Fix the
references to the amount of a rotation.
Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.243
diff -u -r1.243 h8300.c
--- h8300.c 26 Jun 2003 13:04:09 -0000 1.243
+++ h8300.c 26 Jun 2003 13:25:28 -0000
@@ -3990,14 +3990,15 @@
compute_a_rotate_length (rtx *operands)
{
rtx src = operands[1];
+ rtx amount_rtx = operands[2];
enum machine_mode mode = GET_MODE (src);
int amount;
unsigned int length = 0;
- if (GET_CODE (XEXP (src, 1)) != CONST_INT)
- return 0;
+ if (GET_CODE (amount_rtx) != CONST_INT)
+ abort ();
- amount = INTVAL (XEXP (src, 1));
+ amount = INTVAL (amount_rtx);
/* Clean up AMOUNT. */
if (amount < 0)