+2013-11-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data.c: Work around bogus GCC diagnostic about shift count.
+ Reported by Eli Zaretskii in
+ <http://lists.gnu.org/archive/html/emacs-devel/2013-11/msg00489.html>.
+ (pre_value): New function.
+ (count_trailing_zero_bits): Use it.
+
2013-11-15 Eli Zaretskii <eliz@gnu.org>
* lisp.h (DEBUGGER_SEES_C_MACROS) [GCC < v3.5]: Pessimistically
return changed ? dest : Qnil;
}
+/* PRECONDITION must be true. Return VALUE. This odd construction
+ works around a bogus GCC diagnostic "shift count >= width of type". */
+
+static int
+pre_value (bool precondition, int value)
+{
+ eassume (precondition);
+ return precondition ? value : 0;
+}
+
/* Compute the number of trailing zero bits in val. If val is zero,
return the number of bits in val. */
static int
if (BITS_PER_BITS_WORD % BITS_PER_ULL != 0
&& BITS_WORD_MAX == (bits_word) -1)
- val |= (bits_word) 1 << (BITS_PER_BITS_WORD % BITS_PER_ULL);
+ val |= (bits_word) 1 << pre_value (ULONG_MAX < BITS_WORD_MAX,
+ BITS_PER_BITS_WORD % BITS_PER_ULL);
return count + count_trailing_zeros_ll (val);
}
}