]> gcc.gnu.org Git - gcc.git/commit - gcc/c/c-typeck.c
re PR c/7543 (no warning for always-false "if (!a & 0x4)" bitwise and on boolean...
authorManuel López-Ibáñez <manu@gcc.gnu.org>
Fri, 24 Oct 2008 10:09:06 +0000 (10:09 +0000)
committerManuel López-Ibáñez <manu@gcc.gnu.org>
Fri, 24 Oct 2008 10:09:06 +0000 (10:09 +0000)
commit100d537d7a7b5c0ef775d568ce3eefffa72f2c41
tree700b750bc17a07e7749365330c49e0f595aaa435
parent950d63e12fd0a69731a4c1ae313135f2d47d30a9
re PR c/7543 (no warning for always-false "if (!a & 0x4)" bitwise and on boolean value)

2008-10-24  Manuel López-Ibáñez  <manu@gcc.gnu.org>

PR c/7543
* value-prof.c (gimple_stringop_fixed_value): Use parentheses
around bit operation.
* profile.c (is_edge_inconsistent): Likewise.
* fold-const.c (truth_value_p): Move from here...
* tree.h (truth_value_p): ... to here.
* c-tree.h (c_expr): Update description of original_code.
* c-typeck.c (parser_build_unary_op): Set original_code.
(parser_build_binary_op): Update call to warn_about_parentheses.
* c-common.c (warn_about_parentheses): Take two additional
arguments of the operands. Use a switch. Quote operators
appropriately. Define macro APPEARS_TO_BE_BOOLEAN_EXPR_P.
Add warning about !x | y and !x & y.
* c-common.h (warn_about_parentheses): Update declaration.
cp/
* typeck.c (build_x_binary_op): Update call to
warn_about_parentheses.
* parser.c (cp_parser_binary_expression): Add note about passing
the correct code for unary expressions.
testsuite/
* gcc.dg/Wparentheses-11.c: New.
* g++.dg/warn/Wparentheses-25.C: New. XFAILED.

From-SVN: r141340
15 files changed:
gcc/ChangeLog
gcc/c-common.c
gcc/c-common.h
gcc/c-tree.h
gcc/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/cp/typeck.c
gcc/fold-const.c
gcc/profile.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Wparentheses-25.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wparentheses-11.c [new file with mode: 0644]
gcc/tree.h
gcc/value-prof.c
This page took 0.060488 seconds and 5 git commands to generate.