diff options
| author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-15 21:32:03 +0000 |
|---|---|---|
| committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-15 21:32:03 +0000 |
| commit | f8ed8f1f23bfae173dc9bbff52389be294aab208 (patch) | |
| tree | a85c63055a746912d27a8232aac06320d9ffbc5a | |
| parent | e3a7131b06f0e02236df9af180cece83f877cb03 (diff) | |
| download | ppe42-gcc-f8ed8f1f23bfae173dc9bbff52389be294aab208.tar.gz ppe42-gcc-f8ed8f1f23bfae173dc9bbff52389be294aab208.zip | |
* c-typeck.c (build_compound_expr, build_c_cast): Don't try to use
non_lvalue to stop something being a null pointer constant.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89120 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/c-typeck.c | 10 |
2 files changed, 5 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a78f9bb5ea2..0d1ace7ec69 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-10-15 Joseph S. Myers <jsm@polyomino.org.uk> + + * c-typeck.c (build_compound_expr, build_c_cast): Don't try to use + non_lvalue to stop something being a null pointer constant. + 2004-10-15 Aldy Hernandez <aldyh@redhat.com> * config/rs6000/rs6000.h (FUNCTION_ARG_REGNO_P): FPRs are only diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 7cc1024035e..9e4f0fb1501 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -3054,10 +3054,6 @@ build_compound_expr (tree expr1, tree expr2) /* Convert arrays and functions to pointers. */ expr2 = default_function_array_conversion (expr2); - /* Don't let (0, 0) be null pointer constant. */ - if (integer_zerop (expr2)) - expr2 = non_lvalue (expr2); - if (!TREE_SIDE_EFFECTS (expr1)) { /* The left-hand operand of a comma expression is like an expression @@ -3300,12 +3296,6 @@ build_c_cast (tree type, tree expr) } } - /* Don't let (void *) (FOO *) 0 be a null pointer constant. */ - if (TREE_CODE (value) == INTEGER_CST - && TREE_CODE (expr) == INTEGER_CST - && TREE_CODE (TREE_TYPE (expr)) != INTEGER_TYPE) - value = non_lvalue (value); - /* Don't let a cast be an lvalue. */ if (value == expr) value = non_lvalue (value); |

