diff options
author | J"orn Rennecke <joern.rennecke@st.com> | 2005-12-07 23:49:43 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2005-12-07 23:49:43 +0000 |
commit | 1fd5360d19237707850e73a67840fe616b1b9bbe (patch) | |
tree | d2d6de6e04e5e9ea49493e390d736fd025a9e543 /gcc/expr.c | |
parent | 444aea52f66b64d8b960d1751592be836ce3d8c7 (diff) | |
download | gcc-1fd5360d19237707850e73a67840fe616b1b9bbe.zip gcc-1fd5360d19237707850e73a67840fe616b1b9bbe.tar.gz gcc-1fd5360d19237707850e73a67840fe616b1b9bbe.tar.bz2 |
* expr.c (force_operand): Use convert_to_mode for conversions.
From-SVN: r108196
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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 |