[PATCH] Fix problem in the expansion of ROTATE expressions
Olivier Hainque
hainque@act-europe.fr
Wed Mar 24 07:39:00 GMT 2004
I wrote:
> Will adjust the ChangeLog and comments accordingly.
Below is what I checked-in to mainline.
* optabs.c (expand_binop): When synthesizing double word rotates
from single word shifts, use a new register target if the provided
target is not a REG already.
*** gcc/optabs.c.ori 10 Mar 2004 22:36:12 -0000 1.211
--- gcc/optabs.c 23 Mar 2004 14:09:04 -0000
*************** expand_binop (enum machine_mode mode, op
*** 1087,1094 ****
int shift_count, left_shift, outof_word;
/* If TARGET is the same as one of the operands, the REG_EQUAL note
! won't be accurate, so use a new target. */
! if (target == 0 || target == op0 || target == op1)
target = gen_reg_rtx (mode);
start_sequence ();
--- 1087,1098 ----
int shift_count, left_shift, outof_word;
/* If TARGET is the same as one of the operands, the REG_EQUAL note
! won't be accurate, so use a new target. Do this also if target is not
! a REG, first because having a register instead may open optimization
! oportunities, and second because if target and op0 happen to be MEMs
! designating the same location, we would risk clobbering it too early
! in the code sequence we generate below. */
! if (target == 0 || target == op0 || target == op1 || ! REG_P (target))
target = gen_reg_rtx (mode);
start_sequence ();
More information about the Gcc-patches
mailing list