* expr.c (force_operand): Use convert_to_mode for conversions.
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Dec 2005 23:49:43 +0000 (23:49 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Dec 2005 23:49:43 +0000 (23:49 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108196 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/expr.c

index d743f29..189de9b 100644 (file)
@@ -1,5 +1,9 @@
 2005-12-07  J"orn Rennecke <joern.rennecke@st.com>
 
+       * expr.c (force_operand): Use convert_to_mode for conversions.
+
+2005-12-07  J"orn Rennecke <joern.rennecke@st.com>
+
        * reload.h (reg_equiv_invariant): Declare.
        * reload.c (refers_to_regno_for_reload_p): Allow R to be a pseudo
        register also when reg_equiv_invariant[R] is set.
index aaca863..de66a0d 100644 (file)
@@ -5867,8 +5867,20 @@ force_operand (rtx value, rtx target)
     }
   if (UNARY_P (value))
     {
+      int unsignedp = 0;
+
       op1 = force_operand (XEXP (value, 0), NULL_RTX);
-      return expand_simple_unop (GET_MODE (value), code, op1, target, 0);
+      switch (code)
+       {
+       case ZERO_EXTEND: case UNSIGNED_FIX: case UNSIGNED_FLOAT:
+         unsignedp = 1;
+         /* fall through.  */
+       case TRUNCATE:
+       case SIGN_EXTEND: case FIX: case FLOAT:
+         return convert_to_mode (GET_MODE (value), op1, unsignedp);
+       default:
+         return expand_simple_unop (GET_MODE (value), code, op1, target, 0);
+       }
     }
 
 #ifdef INSN_SCHEDULING