summaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-07 23:49:43 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-07 23:49:43 +0000
commit6184cd692fbc241f633ee6b11684eca1479b83b0 (patch)
treed2d6de6e04e5e9ea49493e390d736fd025a9e543 /gcc/expr.c
parent7c5cef0d32f8da7a71fd8cc5fcfd2629ff9b64fb (diff)
downloadgcc-6184cd692fbc241f633ee6b11684eca1479b83b0.tar.gz
* expr.c (force_operand): Use convert_to_mode for conversions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108196 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index aaca86309e7..de66a0d3173 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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