summaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 1f603711cf7..ad003d83cd5 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -3224,9 +3224,7 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode,
GET_MODE (SUBREG_REG (op0)),
XEXP (SUBREG_REG (op0), 0),
tmp);
- return simplify_gen_subreg (mode, tmp, inner_mode,
- subreg_lowpart_offset (mode,
- inner_mode));
+ return lowpart_subreg (mode, tmp, inner_mode);
}
canonicalize_shift:
if (SHIFT_COUNT_TRUNCATED && CONST_INT_P (op1))
@@ -6027,6 +6025,17 @@ simplify_gen_subreg (machine_mode outermode, rtx op,
return NULL_RTX;
}
+/* Generates a subreg to get the least significant part of EXPR (in mode
+ INNER_MODE) to OUTER_MODE. */
+
+rtx
+lowpart_subreg (machine_mode outer_mode, rtx expr,
+ machine_mode inner_mode)
+{
+ return simplify_gen_subreg (outer_mode, expr, inner_mode,
+ subreg_lowpart_offset (outer_mode, inner_mode));
+}
+
/* Simplify X, an rtx expression.
Return the simplified expression or NULL if no simplifications