diff options
| author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-05 14:49:02 +0000 |
|---|---|---|
| committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-05 14:49:02 +0000 |
| commit | 55d865b32b8dd99702591c1292eb6ba7f88ea348 (patch) | |
| tree | c5b32ccc22a5eec42d23c4c1d01785eda8e29425 | |
| parent | e4a1579939ae0d96caffb45978ac382f9d4443ce (diff) | |
| download | ppe42-gcc-55d865b32b8dd99702591c1292eb6ba7f88ea348.tar.gz ppe42-gcc-55d865b32b8dd99702591c1292eb6ba7f88ea348.zip | |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122551 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/fold-const.c | 8 |
2 files changed, 5 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0b6a01d898e..6e28d861419 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,9 @@ 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> PR tree-optimization/26420 diff --git a/gcc/fold-const.c b/gcc/fold-const.c index dab2647ee28..4d59f71111c 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. */ |

