From 9dc167ec4ad8d62e05511c9401f8b72bafb42e77 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Mon, 5 Mar 2007 14:49:02 +0000 Subject: [PATCH] fold-const.c (fold_binary): Remove duplicate folding of comparison of non-null ADDR_EXPR against null. 2007-03-05 Richard Guenther * fold-const.c (fold_binary): Remove duplicate folding of comparison of non-null ADDR_EXPR against null. From-SVN: r122551 --- gcc/ChangeLog | 5 +++++ gcc/fold-const.c | 8 -------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0b6a01d898e3..6e28d8614192 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-03-05 Richard Guenther + + * fold-const.c (fold_binary): Remove duplicate folding + of comparison of non-null ADDR_EXPR against null. + 2007-03-05 Richard Guenther Dorit Nuzman diff --git a/gcc/fold-const.c b/gcc/fold-const.c index dab2647ee288..4d59f71111c3 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -11159,14 +11159,6 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) && code == EQ_EXPR) return fold_build1 (TRUTH_NOT_EXPR, type, arg0); - /* If this is an equality comparison of the address of a non-weak - object against zero, then we know the result. */ - if (TREE_CODE (arg0) == ADDR_EXPR - && VAR_OR_FUNCTION_DECL_P (TREE_OPERAND (arg0, 0)) - && ! DECL_WEAK (TREE_OPERAND (arg0, 0)) - && integer_zerop (arg1)) - return constant_boolean_node (code != EQ_EXPR, type); - /* If this is an equality comparison of the address of two non-weak, unaliased symbols neither of which are extern (since we do not have access to attributes for externs), then we know the result. */