aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index d0e07821489..79204bd49e4 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -4361,9 +4361,12 @@ expand_debug_expr (tree exp)
else
op0 = simplify_gen_unary (FIX, mode, op0, inner_mode);
}
- else if (CONSTANT_P (op0)
- || GET_MODE_PRECISION (mode) <= GET_MODE_PRECISION (inner_mode))
+ else if (GET_MODE_UNIT_PRECISION (mode)
+ == GET_MODE_UNIT_PRECISION (inner_mode))
op0 = lowpart_subreg (mode, op0, inner_mode);
+ else if (GET_MODE_UNIT_PRECISION (mode)
+ < GET_MODE_UNIT_PRECISION (inner_mode))
+ op0 = simplify_gen_unary (TRUNCATE, mode, op0, inner_mode);
else if (UNARY_CLASS_P (exp)
? TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)))
: unsignedp)
@@ -5222,9 +5225,12 @@ expand_debug_source_expr (tree exp)
else
op0 = simplify_gen_unary (FIX, mode, op0, inner_mode);
}
- else if (CONSTANT_P (op0)
- || GET_MODE_BITSIZE (mode) <= GET_MODE_BITSIZE (inner_mode))
+ else if (GET_MODE_UNIT_PRECISION (mode)
+ == GET_MODE_UNIT_PRECISION (inner_mode))
op0 = lowpart_subreg (mode, op0, inner_mode);
+ else if (GET_MODE_UNIT_PRECISION (mode)
+ < GET_MODE_UNIT_PRECISION (inner_mode))
+ op0 = simplify_gen_unary (TRUNCATE, mode, op0, inner_mode);
else if (TYPE_UNSIGNED (TREE_TYPE (exp)))
op0 = simplify_gen_unary (ZERO_EXTEND, mode, op0, inner_mode);
else