diff options
author | sje <sje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-08-19 18:18:12 +0000 |
---|---|---|
committer | sje <sje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-08-19 18:18:12 +0000 |
commit | dd06736221e44091252e1bb6985d5d3e5fd0ea5f (patch) | |
tree | 90d5a658b60ca93c1db59343c9ba71bdd464f467 /gcc/combine.c | |
parent | 31c07a4029037bef4530cb55882b651438c1c550 (diff) | |
download | gcc-dd06736221e44091252e1bb6985d5d3e5fd0ea5f.tar.gz |
* machmode.h (SCALAR_INT_MODE_P): New macro to test for
scaler integer mode (MODE_INT or MODE_PARTIAL_INT).
* explow.c (trunc_int_for_mode): Abort when the mode is not
a scaler integer mode.
* combine.c (expand_compound_operation): Don't expand Vector
or Complex modes into shifts.
(expand_field_assignment): Don't do bitwise arithmatic and
shifts on Vector or Complex modes.
(simplify_comparison): Don't call trunc_int_for_mode
for VOIDmode.
* recog.c (general_operand): Likewise.
(immediate_operand): Likewise.
(nonmemory_operand): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56443 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 236ac2ef72c..4a2ae3c9743 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -5634,6 +5634,12 @@ expand_compound_operation (x) if (GET_MODE_SIZE (GET_MODE (XEXP (x, 0))) > UNITS_PER_WORD) return x; + /* Reject MODEs that aren't scalar integers because turning vector + or complex modes into shifts causes problems. */ + + if (! SCALAR_INT_MODE_P (GET_MODE (XEXP (x, 0)))) + return x; + len = GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))); /* If the inner object has VOIDmode (the only way this can happen is if it is an ASM_OPERANDS), we can't do anything since we don't @@ -5655,6 +5661,12 @@ expand_compound_operation (x) || GET_MODE (XEXP (x, 0)) == VOIDmode) return x; + /* Reject MODEs that aren't scalar integers because turning vector + or complex modes into shifts causes problems. */ + + if (! SCALAR_INT_MODE_P (GET_MODE (XEXP (x, 0)))) + return x; + len = INTVAL (XEXP (x, 1)); pos = INTVAL (XEXP (x, 2)); @@ -5862,12 +5874,12 @@ expand_field_assignment (x) compute_mode = GET_MODE (inner); - /* Don't attempt bitwise arithmetic on non-integral modes. */ - if (! INTEGRAL_MODE_P (compute_mode)) + /* Don't attempt bitwise arithmetic on non scalar integer modes. */ + if (! SCALAR_INT_MODE_P (compute_mode)) { enum machine_mode imode; - /* Something is probably seriously wrong if this matches. */ + /* Don't do anything for vector or complex integral types. */ if (! FLOAT_MODE_P (compute_mode)) break; @@ -10177,7 +10189,9 @@ simplify_comparison (code, pop0, pop1) /* Get the constant we are comparing against and turn off all bits not on in our mode. */ - const_op = trunc_int_for_mode (INTVAL (op1), mode); + const_op = INTVAL (op1); + if (mode != VOIDmode) + const_op = trunc_int_for_mode (const_op, mode); op1 = GEN_INT (const_op); /* If we are comparing against a constant power of two and the value |