From 1e537948675aa0543bad80ab38f931f16b145d1a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez?= <manu@gcc.gnu.org>
Date: Tue, 8 May 2012 22:14:34 +0000
Subject: [PATCH] re PR c++/53261 (ICE in tree_strip_nop_conversions)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

2012-05-09  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR c++/53261
c-family/
	* c-common.c (warn_logical_operator): Check that argument of
	integer_zerop is not NULL.

From-SVN: r187300
---
 gcc/c-family/ChangeLog  | 6 ++++++
 gcc/c-family/c-common.c | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index accb9850074c..52a7f5c9a407 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-09  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+	PR c++/53261
+	* c-common.c (warn_logical_operator): Check that argument of
+	integer_zerop is not NULL.
+
 2012-05-05  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
 	PR c/43772
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 04a265f97db0..1cdef9a995c3 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -1629,7 +1629,7 @@ warn_logical_operator (location_t location, enum tree_code code, tree type,
     in0_p = !in0_p;
 
   tem = build_range_check (UNKNOWN_LOCATION, type, lhs, in0_p, low0, high0);
-  if (integer_zerop (tem))
+  if (tem && integer_zerop (tem))
     return;
 
   rhs = make_range (op_right, &in1_p, &low1, &high1, &strict_overflow_p);
@@ -1644,7 +1644,7 @@ warn_logical_operator (location_t location, enum tree_code code, tree type,
     in1_p = !in1_p;
 
   tem = build_range_check (UNKNOWN_LOCATION, type, rhs, in1_p, low1, high1);
-  if (integer_zerop (tem))
+  if (tem && integer_zerop (tem))
     return;
 
   /* If both expressions have the same operand, if we can merge the
-- 
GitLab