diff options
author | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-06 23:11:51 +0000 |
---|---|---|
committer | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-06 23:11:51 +0000 |
commit | b537bfdbb09508753dd3395a645c7900fc995c84 (patch) | |
tree | 5f9f7faef58377378ef03c74cddbf4a06d8c42d4 /gcc/combine.c | |
parent | e2502ff17240af0e64f6abe47701a6b54d427c25 (diff) | |
download | gcc-b537bfdbb09508753dd3395a645c7900fc995c84.tar.gz |
* emit-rtl.c (paradoxical_subreg_p): New function.
* rtl.h (paradoxical_subreg_p): Declare.
* combine.c (set_nonzero_bits_and_sign_copies, get_last_value,
apply_distributive_law, simplify_comparison, simplify_set): Use it.
* cse.c (record_jump_cond, cse_insn): Likewise.
* expr.c (force_operand): Likewise.
* rtlanal.c (num_sign_bit_copies1): Likewise.
* reload1.c (eliminate_regs_1, strip_paradoxical_subreg): Likewise.
* reload.c (push_secondary_reload, find_reloads_toplev): Likewise.
(push_reload): Use precision to check for paradoxical subregs.
* expmed.c (extract_bit_field_1): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175944 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 9edfdd18b1c..afc56b1d847 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -1610,9 +1610,7 @@ set_nonzero_bits_and_sign_copies (rtx x, const_rtx set, void *data) set what we know about X. */ if (SET_DEST (set) == x - || (GET_CODE (SET_DEST (set)) == SUBREG - && (GET_MODE_SIZE (GET_MODE (SET_DEST (set))) - > GET_MODE_SIZE (GET_MODE (SUBREG_REG (SET_DEST (set))))) + || (paradoxical_subreg_p (SET_DEST (set)) && SUBREG_REG (SET_DEST (set)) == x)) { rtx src = SET_SRC (set); @@ -6564,8 +6562,7 @@ simplify_set (rtx x) && INTEGRAL_MODE_P (GET_MODE (SUBREG_REG (src))) && LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (src))) != UNKNOWN && SUBREG_BYTE (src) == 0 - && (GET_MODE_SIZE (GET_MODE (src)) - > GET_MODE_SIZE (GET_MODE (SUBREG_REG (src)))) + && paradoxical_subreg_p (src) && MEM_P (SUBREG_REG (src))) { SUBST (SET_SRC (x), @@ -9260,8 +9257,7 @@ apply_distributive_law (rtx x) || ! subreg_lowpart_p (lhs) || (GET_MODE_CLASS (GET_MODE (lhs)) != GET_MODE_CLASS (GET_MODE (SUBREG_REG (lhs)))) - || (GET_MODE_SIZE (GET_MODE (lhs)) - > GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs)))) + || paradoxical_subreg_p (lhs) || VECTOR_MODE_P (GET_MODE (lhs)) || GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs))) > UNITS_PER_WORD /* Result might need to be truncated. Don't change mode if @@ -11139,9 +11135,8 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) HOST_WIDE_INT c1 = INTVAL (XEXP (op1, 1)); int changed = 0; - if (GET_CODE (inner_op0) == SUBREG && GET_CODE (inner_op1) == SUBREG - && (GET_MODE_SIZE (GET_MODE (inner_op0)) - > GET_MODE_SIZE (GET_MODE (SUBREG_REG (inner_op0)))) + if (paradoxical_subreg_p (inner_op0) + && GET_CODE (inner_op1) == SUBREG && (GET_MODE (SUBREG_REG (inner_op0)) == GET_MODE (SUBREG_REG (inner_op1))) && (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (inner_op0))) @@ -11984,8 +11979,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) && GET_MODE_CLASS (GET_MODE (SUBREG_REG (op0))) == MODE_INT && (code == NE || code == EQ)) { - if (GET_MODE_SIZE (GET_MODE (op0)) - > GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0)))) + if (paradoxical_subreg_p (op0)) { /* For paradoxical subregs, allow case 1 as above. Case 3 isn't implemented. */ @@ -12721,8 +12715,7 @@ get_last_value (const_rtx x) we cannot predict what values the "extra" bits might have. */ if (GET_CODE (x) == SUBREG && subreg_lowpart_p (x) - && (GET_MODE_SIZE (GET_MODE (x)) - <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))) + && !paradoxical_subreg_p (x) && (value = get_last_value (SUBREG_REG (x))) != 0) return gen_lowpart (GET_MODE (x), value); |