This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Another force_reg patch
- To: rth at cygnus dot com
- Subject: Re: Another force_reg patch
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Fri, 30 Jul 1999 14:28:18 +0100
- CC: gcc-patches at gcc dot gnu dot org
Hi Richard,
: > Here is a patch very similar to my last one that fixes up a couple of
: > places (in expand_assignment and expand_expr) where force_reg is used
: > inappropriately.
:
: Actually, I wonder if making force_reg call force_operand
: (as copy_to_reg does) would be more appropriate.
Like this you mean ?
Cheers
Nick
Fri Jul 30 14:27:22 1999 Nick Clifton <nickc@cygnus.com>
* explow.c (force_reg): Call force_operand if X does not
satisfy general_operand.
Index: explow.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/explow.c,v
retrieving revision 1.29
diff -p -r1.29 explow.c
*** explow.c 1999/07/23 01:21:31 1.29
--- explow.c 1999/07/30 13:26:11
*************** force_reg (mode, x)
*** 730,736 ****
--- 730,741 ----
if (GET_CODE (x) == REG)
return x;
+
temp = gen_reg_rtx (mode);
+
+ if (! general_operand (x, mode))
+ x = force_operand (x, NULL_RTX);
+
insn = emit_move_insn (temp, x);
/* Let optimizers know that TEMP's value never changes