aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/simplify.c
diff options
Diffstat (limited to 'simplify.c')
-rw-r--r--simplify.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/simplify.c b/simplify.c
index 2bc86f53..6555da5f 100644
--- a/simplify.c
+++ b/simplify.c
@@ -944,6 +944,10 @@ 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))
+ return 0;
+
orig_size = orig_type->bit_size;
size = insn->size;
src = insn->src;