summaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-17 18:36:44 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-17 18:36:44 +0000
commit0969aa9b3d99874b004c7cfc9dba1eba44ec7b7c (patch)
tree3aa01e967c3a6466432e59fd7a374b018575b3e0 /gcc/c-common.c
parenteac53a7cf5f7ae50cb7d4abc91ae6705d59a296d (diff)
downloadgcc-0969aa9b3d99874b004c7cfc9dba1eba44ec7b7c.tar.gz
gcc/
2009-05-17 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/40172 * c-common.c (warn_logical_operator): Don't warn if one of expression isn't always true or false. gcc/testscase/ 2009-05-17 H.J. Lu <hongjiu.lu@intel.com> PR c/40172 * gcc.dg/pr40172.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147639 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index e5c3d0d2eee..fadbdaa7d93 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -1784,10 +1784,8 @@ warn_logical_operator (location_t location, enum tree_code code, tree type,
in0_p = !in0_p, in1_p = !in1_p;
/* If both expressions are the same, if we can merge the ranges, and we
- can build the range test, return it or it inverted. If one of the
- ranges is always true or always false, consider it to be the same
- expression as the other. */
- if ((lhs == 0 || rhs == 0 || operand_equal_p (lhs, rhs, 0))
+ can build the range test, return it or it inverted. */
+ if (lhs && rhs && operand_equal_p (lhs, rhs, 0)
&& merge_ranges (&in_p, &low, &high, in0_p, low0, high0,
in1_p, low1, high1)
&& 0 != (tem = build_range_check (type,