This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Your change to jump.c breaks conditional move?
- To: "H.J. Lu" <hjl at lucon dot org>, rth at cygnus dot com
- Subject: Re: Your change to jump.c breaks conditional move?
- From: Richard Henderson <rth at cygnus dot com>
- Date: Thu, 4 Jun 1998 11:53:58 -0700
- Cc: egcs-patches at cygnus dot com, egcs at cygnus dot com
- References: <19980604112511.A3963@dot.cygnus.com> <m0yhejE-000268C@ocean.lucon.org>
- Reply-To: Richard Henderson <rth at cygnus dot com>
On Thu, Jun 04, 1998 at 11:27:08AM -0700, H.J. Lu wrote:
> I think either way we should handle it. We can put abort () there if
> we don't think it is very likely. Otherwise, we handle it like PLUS.
Ok, here is an alternate patch. I also realized I should have
been checking the other side of the op for a symbol.
r~
Index: expr.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/expr.c,v
retrieving revision 1.64
diff -c -p -d -r1.64 expr.c
*** expr.c 1998/06/02 22:48:51 1.64
--- expr.c 1998/06/04 18:51:50
*************** force_operand (value, target)
*** 4525,4530 ****
--- 4525,4542 ----
/* Use subtarget as the target for operand 0 of a binary operation. */
register rtx subtarget = (target != 0 && GET_CODE (target) == REG ? target : 0);
+ /* Check for a PIC address load. */
+ if (flag_pic
+ && (GET_CODE (value) == PLUS || GET_CODE (value) == MINUS)
+ && XEXP (value, 0) == pic_offset_table_rtx
+ && GET_CODE (XEXP (value, 1)) == SYMBOL_REF)
+ {
+ if (!subtarget)
+ subtarget = gen_reg_rtx (GET_MODE (value));
+ emit_move_insn (subtarget, value);
+ return subtarget;
+ }
+
if (GET_CODE (value) == PLUS)
binoptab = add_optab;
else if (GET_CODE (value) == MINUS)