]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2007-03-05 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Mar 2007 14:49:02 +0000 (14:49 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Mar 2007 14:49:02 +0000 (14:49 +0000)
* fold-const.c (fold_binary): Remove duplicate folding
of comparison of non-null ADDR_EXPR against null.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122551 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/fold-const.c

index 0b6a01d898e3942ebe6922225841eced9ffd6340..6e28d8614192c38f5dfd00b2b49e1b1476175a6b 100644 (file)
@@ -1,3 +1,8 @@
+2007-03-05  Richard Guenther  <rguenther@suse.de>
+
+       * fold-const.c (fold_binary): Remove duplicate folding
+       of comparison of non-null ADDR_EXPR against null.
+
 2007-03-05  Richard Guenther  <rguenther@suse.de>
        Dorit Nuzman  <dorit@il.ibm.com>
 
index dab2647ee288cb26cc05de4bb4e9b322eaeb5d07..4d59f71111c3ad56188a401d44f6e18a295ac881 100644 (file)
@@ -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.  */