This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR optimization/14235
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 3 Mar 2004 21:18:50 +0100
- Subject: Re: [PATCH] Fix PR optimization/14235
- References: <10403031318.AA07231@vlsi1.ultra.nyu.edu>
> I'd suggest doing it in convert_move rather than having its caller
> guess what it'll do. Also, the call to safe_from_p is strange given
> that we've already evaluated TREE_OPERAND and we know what it is.
Of course. For some reason, I managed to convince myself that I needed to
scan the tree, which ruled out putting the fix in convert_move. Once this
requirement is lifted, the fix is straightforward. OK for mainline and 3.4
branch after the usual testing?
Thanks for your help.
2004-03-03 Eric Botcazou <firstname.lastname@example.org>
* expr.c (convert_move): Copy the source to a new pseudo
when converting from a sub-word source to a larger-than-word
register which conflicts with the source.
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.615.4.5
diff -u -p -r1.615.4.5 expr.c
--- expr.c 27 Feb 2004 08:14:59 -0000 1.615.4.5
+++ expr.c 3 Mar 2004 20:09:11 -0000
@@ -687,7 +687,11 @@ convert_move (rtx to, rtx from, int unsi
if (GET_CODE (to) == REG)
- emit_insn (gen_rtx_CLOBBER (VOIDmode, to));
+ if (reg_overlap_mentioned_p (to, from))
+ from = force_reg (from_mode, from);
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, to));
convert_move (gen_lowpart (word_mode, to), from, unsignedp);
emit_unop_insn (code, to,
gen_lowpart (word_mode, to), equiv_code);