diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-01-24 00:40:58 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-01-24 00:40:58 +0000 |
commit | 90bfe8410789a3da913e49f573c19bd1ed6d2d4f (patch) | |
tree | 6cb881e88fb00543603561ed94327e1193a31b12 /gcc/combine.c | |
parent | c7f7c0f4a7e7111c3fdf11745d2ad1df1b38306b (diff) | |
download | gcc-90bfe8410789a3da913e49f573c19bd1ed6d2d4f.tar.gz |
(subst, case SUBREG): Handle paradoxical SUBREG of constant.
(IF_THEN_ELSE): Add missing "else" and check for comparison before
calling reversible_comparison_p.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6419 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 1737e6ec465..d682939eb28 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -3216,6 +3216,12 @@ subst (x, from, to, in_dest, unique_copy) ) return gen_lowpart_for_combine (mode, SUBREG_REG (x)); + /* A paradoxical SUBREG of a VOIDmode constant is the same constant, + since we are saying that the high bits don't matter. */ + if (CONSTANT_P (SUBREG_REG (x)) && GET_MODE (SUBREG_REG (x)) == VOIDmode + && GET_MODE_SIZE (mode) > GET_MODE_SIZE (op0_mode)) + return SUBREG_REG (x); + /* If we are narrowing an integral object, we need to see if we can simplify the expression for the object knowing that we only need the low-order bits. */ @@ -4002,12 +4008,13 @@ subst (x, from, to, in_dest, unique_copy) m = GET_MODE (XEXP (t, 0)); } - if (reversible_comparison_p (XEXP (x, 0)) - && (GET_CODE (f) == PLUS || GET_CODE (f) == MINUS - || GET_CODE (f) == IOR || GET_CODE (f) == XOR - || GET_CODE (f) == ASHIFT - || GET_CODE (f) == LSHIFTRT || GET_CODE (f) == ASHIFTRT) - && rtx_equal_p (XEXP (f, 0), t)) + else if (GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == '<' + && reversible_comparison_p (XEXP (x, 0)) + && (GET_CODE (f) == PLUS || GET_CODE (f) == MINUS + || GET_CODE (f) == IOR || GET_CODE (f) == XOR + || GET_CODE (f) == ASHIFT + || GET_CODE (f) == LSHIFTRT || GET_CODE (f) == ASHIFTRT) + && rtx_equal_p (XEXP (f, 0), t)) { c1 = XEXP (f, 1), op = GET_CODE (f), z = t; cond_op = reverse_condition (cond_op); |