diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 231dccddbf68f87fffffea25c42bc573cc22b199..ef0c63289c0ac1f3df0cbfa9e678137810b895ac 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2003-06-09  Jason Merrill  <jason@redhat.com>
+
+	* fold-const.c (operand_equal_p): Handle ADDR_EXPR and TRUTH_NOT_EXPR.
+
 2003-06-19  Osku Salerma  <osku@iki.fi>
 
 	* c-format.c (check_format_string, get_constant): New.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index c97213a66e11f594e74483bbb5b307836070032f..1f118e891eb6cf88a5c33ce28e398f5e0a38e824 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2000,9 +2000,19 @@ operand_equal_p (arg0, arg1, only_const)
 	}
 
     case 'e':
-      if (TREE_CODE (arg0) == RTL_EXPR)
-	return rtx_equal_p (RTL_EXPR_RTL (arg0), RTL_EXPR_RTL (arg1));
-      return 0;
+      switch (TREE_CODE (arg0))
+	{
+	case ADDR_EXPR:
+	case TRUTH_NOT_EXPR:
+	  return operand_equal_p (TREE_OPERAND (arg0, 0),
+				  TREE_OPERAND (arg1, 0), 0);
+
+	case RTL_EXPR:
+	  return rtx_equal_p (RTL_EXPR_RTL (arg0), RTL_EXPR_RTL (arg1));
+
+	default:
+	  return 0;
+	}
 
     default:
       return 0;