aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/simplify.c
diff options
Diffstat (limited to 'simplify.c')
-rw-r--r--simplify.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/simplify.c b/simplify.c
index be720860..ccf0a5f5 100644
--- a/simplify.c
+++ b/simplify.c
@@ -955,8 +955,8 @@ static int simplify_cast(struct instruction *insn)
if (is_ptr_type(orig_type) || is_ptr_type(insn->type))
return 0;
- /* Keep float-to-int casts */
- if (is_float_type(orig_type) && !is_float_type(insn->type))
+ /* Keep float-to-int and int-to-float casts */
+ if (is_float_type(orig_type) != is_float_type(insn->type))
return 0;
orig_size = orig_type->bit_size;