From f834806177042ee269333855dee99fda84bc7c26 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Mon, 24 Oct 2016 17:14:41 +0000 Subject: c-common.c (c_common_truthvalue_conversion): Warn for multiplications in boolean context. 2016-10-24 Bernd Edlinger * c-common.c (c_common_truthvalue_conversion): Warn for multiplications in boolean context. Fix the quoting of '<<' and '<' in the shift warning. gcc: 2016-10-24 Bernd Edlinger * doc/invoke.text (Wint-in-bool-context): Update documentation. * value-prof.c (stringop_block_profile): Fix a warning. testsuite: 2016-10-24 Bernd Edlinger * c-c++-common/Wint-in-bool-context-3.c: New test. From-SVN: r241490 --- gcc/value-prof.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/value-prof.c') diff --git a/gcc/value-prof.c b/gcc/value-prof.c index e794e6d..dc57069 100644 --- a/gcc/value-prof.c +++ b/gcc/value-prof.c @@ -1878,12 +1878,12 @@ stringop_block_profile (gimple *stmt, unsigned int *expected_align, else { gcov_type count; - int alignment; + unsigned int alignment; count = histogram->hvalue.counters[0]; alignment = 1; while (!(count & alignment) - && (alignment * 2 * BITS_PER_UNIT)) + && (alignment <= UINT_MAX / 2 / BITS_PER_UNIT)) alignment <<= 1; *expected_align = alignment * BITS_PER_UNIT; gimple_remove_histogram_value (cfun, stmt, histogram); -- cgit v1.1