aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl@gcc.gnu.org>2009-05-17 11:36:44 -0700
committerH.J. Lu <hjl@gcc.gnu.org>2009-05-17 11:36:44 -0700
commitae8af5003b1712523c0b09b17f21ba54b38123d7 (patch)
tree3aa01e967c3a6466432e59fd7a374b018575b3e0 /gcc/c-common.c
parent7e361ae60a7b275571bba267b2354b72df40c99a (diff)
downloadgcc-ae8af5003b1712523c0b09b17f21ba54b38123d7.zip
gcc-ae8af5003b1712523c0b09b17f21ba54b38123d7.tar.gz
gcc-ae8af5003b1712523c0b09b17f21ba54b38123d7.tar.bz2
re PR c/40172 (Revision 147596 breaks bootstrap)
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. From-SVN: r147639
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 e5c3d0d..fadbdaa 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,