This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR optimization/14235

> 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  <>

        PR optimization/14235
        * 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.

Eric Botcazou
Index: expr.c
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
 		   != CODE_FOR_nothing))
 	  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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]