diff options
Diffstat (limited to 'gcc/config/arm/arm.cc')
| -rw-r--r-- | gcc/config/arm/arm.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/config/arm/arm.cc b/gcc/config/arm/arm.cc index 20d3f1f..1f413b6 100644 --- a/gcc/config/arm/arm.cc +++ b/gcc/config/arm/arm.cc @@ -5700,8 +5700,6 @@ arm_canonicalize_comparison (int *code, rtx *op0, rtx *op1, if (mode == VOIDmode) mode = GET_MODE (*op1); - maxval = (HOST_WIDE_INT_1U << (GET_MODE_BITSIZE (mode) - 1)) - 1; - /* For floating-point comparisons, prefer >= and > over <= and < since the former are supported by VSEL on some architectures. Only do this if both operands are registers. */ @@ -5718,6 +5716,13 @@ arm_canonicalize_comparison (int *code, rtx *op0, rtx *op1, return; } + /* Everything below assumes an integer mode. */ + if (GET_MODE_CLASS (mode) != MODE_INT + || GET_MODE_BITSIZE (mode) > HOST_BITS_PER_WIDE_INT) + return; + + maxval = (HOST_WIDE_INT_1U << (GET_MODE_BITSIZE (mode) - 1)) - 1; + /* For DImode, we have GE/LT/GEU/LTU comparisons (with cmp/sbc). In ARM mode we can also use cmp/cmpeq for GTU/LEU. GT/LE must be either reversed or (for constant OP1) adjusted to GE/LT. |
