aboutsummaryrefslogtreecommitdiff
path: root/gcc/value-prof.c
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2016-10-24 17:14:41 +0000
committerBernd Edlinger <edlinger@gcc.gnu.org>2016-10-24 17:14:41 +0000
commitf834806177042ee269333855dee99fda84bc7c26 (patch)
tree192f2356af6a042207d630b08e779de14912326f /gcc/value-prof.c
parent1eb4547b1058d6a4e1912ac0f15cc0a69bf4fd78 (diff)
downloadgcc-f834806177042ee269333855dee99fda84bc7c26.zip
gcc-f834806177042ee269333855dee99fda84bc7c26.tar.gz
gcc-f834806177042ee269333855dee99fda84bc7c26.tar.bz2
c-common.c (c_common_truthvalue_conversion): Warn for multiplications in boolean context.
2016-10-24 Bernd Edlinger <bernd.edlinger@hotmail.de> * 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 <bernd.edlinger@hotmail.de> * doc/invoke.text (Wint-in-bool-context): Update documentation. * value-prof.c (stringop_block_profile): Fix a warning. testsuite: 2016-10-24 Bernd Edlinger <bernd.edlinger@hotmail.de> * c-c++-common/Wint-in-bool-context-3.c: New test. From-SVN: r241490
Diffstat (limited to 'gcc/value-prof.c')
-rw-r--r--gcc/value-prof.c4
1 files changed, 2 insertions, 2 deletions
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);