From: Georg-Johann Lay Date: Tue, 18 Jul 2017 09:36:21 +0000 (+0000) Subject: re PR target/81473 ([avr] build fails due to INT8_MIN and friends.) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f94f48ffacd568e76d526f2cb8f7347c599affda;p=gcc.git re PR target/81473 ([avr] build fails due to INT8_MIN and friends.) gcc/ PR target/81473 * config/avr/avr.c (avr_optimize_casesi): Don't use INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX. From-SVN: r250301 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c2156f6a20..e2212364af4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-07-18 Georg-Johann Lay + + PR target/81473 + * config/avr/avr.c (avr_optimize_casesi): Don't use + INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX. + 2017-07-18 Robin Dapp * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Remove diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 0abfa13df94..1f333ccc1b2 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -553,9 +553,9 @@ avr_optimize_casesi (rtx_insn *insns[6], rtx *xop) HOST_WIDE_INT hig_idx = low_idx + num_idx; // Maximum ranges of (un)signed QImode resp. HImode. - int imin = QImode == mode ? INT8_MIN : INT16_MIN; - int imax = QImode == mode ? INT8_MAX : INT16_MAX; - unsigned umax = QImode == mode ? UINT8_MAX : UINT16_MAX; + unsigned umax = QImode == mode ? 0xff : 0xffff; + int imax = QImode == mode ? 0x7f : 0x7fff; + int imin = -imax - 1; // Testing the case range and whether it fits into the range of the // (un)signed mode. This test should actually always pass because it