diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2009-05-15 20:08:21 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2009-05-15 20:08:21 +0000 |
commit | a243fb4a5bb588bbb4b7292a410b9594d7bf6e8d (patch) | |
tree | 6ee4203c725a3a87b87a38848ee077c8ed6e23a3 /gcc/fold-const.c | |
parent | 1b53c5f35fc8175a6dc1462c4b920c58377b13f1 (diff) | |
download | gcc-a243fb4a5bb588bbb4b7292a410b9594d7bf6e8d.zip gcc-a243fb4a5bb588bbb4b7292a410b9594d7bf6e8d.tar.gz gcc-a243fb4a5bb588bbb4b7292a410b9594d7bf6e8d.tar.bz2 |
re PR c/16302 (gcc fails to warn about some common logic errors)
2009-05-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 16302
* fold-const.c (make_range,build_range_check,merge_ranges): Move
declaration to...
(merge_ranges): Returns bool.
* tree.h (make_range): .. to here.
(build_range_check): Likewise.
(merge_ranges): Likewise. Renamed from merge_ranges.
* c-typeck.c (parser_build_binary_op): Update calls to
warn_logical_operator.
* c-common.c (warn_logical_operator): Add new warning.
* c-common.h (warn_logical_operator): Update declaration.
cp/
* call.c (build_new_op): Update calls to warn_logical_operator.
testsuite/
* gcc.dg/pr16302.c: New.
* g++.dg/warn/pr16302.C: New.
From-SVN: r147596
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 1a1a80f..4b8fe38 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -119,10 +119,10 @@ static int simple_operand_p (const_tree); static tree range_binop (enum tree_code, tree, tree, int, tree, int); static tree range_predecessor (tree); static tree range_successor (tree); -static tree make_range (tree, int *, tree *, tree *, bool *); -static tree build_range_check (tree, tree, int, tree, tree); -static int merge_ranges (int *, tree *, tree *, int, tree, tree, int, tree, - tree); +extern tree make_range (tree, int *, tree *, tree *, bool *); +extern tree build_range_check (tree, tree, int, tree, tree); +extern bool merge_ranges (int *, tree *, tree *, int, tree, tree, int, + tree, tree); static tree fold_range_test (enum tree_code, tree, tree, tree); static tree fold_cond_expr_with_comparison (tree, tree, tree, tree); static tree unextend (tree, int, int, tree); @@ -4414,7 +4414,7 @@ range_binop (enum tree_code code, tree type, tree arg0, int upper0_p, because signed overflow is undefined; otherwise, do not change *STRICT_OVERFLOW_P. */ -static tree +tree make_range (tree exp, int *pin_p, tree *plow, tree *phigh, bool *strict_overflow_p) { @@ -4706,7 +4706,7 @@ make_range (tree exp, int *pin_p, tree *plow, tree *phigh, type, TYPE, return an expression to test if EXP is in (or out of, depending on IN_P) the range. Return 0 if the test couldn't be created. */ -static tree +tree build_range_check (tree type, tree exp, int in_p, tree low, tree high) { tree etype = TREE_TYPE (exp), value; @@ -4877,7 +4877,7 @@ range_successor (tree val) /* Given two ranges, see if we can merge them into one. Return 1 if we can, 0 if we can't. Set the output range into the specified parameters. */ -static int +bool merge_ranges (int *pin_p, tree *plow, tree *phigh, int in0_p, tree low0, tree high0, int in1_p, tree low1, tree high1) { |