From: Jakub Jelinek Date: Wed, 13 Feb 2019 12:12:09 +0000 (+0100) Subject: re PR middle-end/89281 (gcc/optabs.c:3901:30: runtime error: shift exponent 32 is... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=548538ce07ce78151dbaf2efdf48bb514794b915;p=gcc.git re PR middle-end/89281 (gcc/optabs.c:3901:30: runtime error: shift exponent 32 is too large for 32-bit type 'int') 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: r268841 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 832f1a3bb7b..b766cb8b68b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2019-02-13 Jakub Jelinek + 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. + PR target/89290 * config/i386/predicates.md (x86_64_immediate_operand): Allow TLS UNSPECs offsetted by signed 32-bit CONST_INT even with diff --git a/gcc/optabs.c b/gcc/optabs.c index f2ca4359162..a0e361b8bfe 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -3898,7 +3898,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 (GET_MODE (size))) > GET_MODE_BITSIZE (cmp_mode))) continue;