diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-02-14 08:40:33 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-02-14 08:40:33 +0100 |
commit | a6f2048f43fec1f591185cb1925c6d787083c28c (patch) | |
tree | 788ebcb50345738e648486f97a0d67a9709fcb75 /gcc/optabs.c | |
parent | 2c1b2a9f5976542e39f16744ae0443e621e5dc6b (diff) | |
download | gcc-a6f2048f43fec1f591185cb1925c6d787083c28c.zip gcc-a6f2048f43fec1f591185cb1925c6d787083c28c.tar.gz gcc-a6f2048f43fec1f591185cb1925c6d787083c28c.tar.bz2 |
backport: re PR middle-end/89281 (gcc/optabs.c:3901:30: runtime error: shift exponent 32 is too large for 32-bit type 'int')
Backported from mainline
2019-02-13 Jakub Jelinek <jakub@redhat.com>
PR middle-end/89281
* optabs.c (prepare_cmp_insn): Use UINTVAL (size) instead of
INTVAL (size), compare it to GET_MODE_MASK instead of
1 << GET_MODE_BITSIZE.
From-SVN: r268865
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index b72e904..b31016c 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -3857,7 +3857,7 @@ prepare_cmp_insn (rtx x, rtx y, enum rtx_code comparison, rtx size, /* Must make sure the size fits the insn's mode. */ if (CONST_INT_P (size) - ? INTVAL (size) >= (1 << GET_MODE_BITSIZE (cmp_mode)) + ? UINTVAL (size) > GET_MODE_MASK (cmp_mode) : (GET_MODE_BITSIZE (as_a <scalar_int_mode> (GET_MODE (size))) > GET_MODE_BITSIZE (cmp_mode))) continue; |