diff options
author | Jason Merrill <jason@gcc.gnu.org> | 1998-08-13 12:12:55 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1998-08-13 12:12:55 -0400 |
commit | ff59bfe6b2ea13d9bb6171a43a5957e03a73901f (patch) | |
tree | a6ff7c8e7d25278a337f2dcc9679eaa22d0df471 /gcc/fold-const.c | |
parent | 0d906a5f369e6c35c32c7f5489dd4027c823973e (diff) | |
download | gcc-ff59bfe6b2ea13d9bb6171a43a5957e03a73901f.zip gcc-ff59bfe6b2ea13d9bb6171a43a5957e03a73901f.tar.gz gcc-ff59bfe6b2ea13d9bb6171a43a5957e03a73901f.tar.bz2 |
expr.c (safe_from_p): Change code to ERROR_MARK only when not accessing nodes.
* expr.c (safe_from_p): Change code to ERROR_MARK only when not
accessing nodes.
* toplev.c (display_help): Add braces to shut up warnings.
* fold-const.c (non_lvalue): Don't deal with null pointer
constants here.
(fold, case COMPOUND_EXPR): Wrap a constant 0 in a NOP_EXPR.
From-SVN: r21698
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 4fe6899..c84d52c 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -1679,8 +1679,7 @@ fold_convert (t, arg1) return t; } -/* Return an expr equal to X but certainly not valid as an lvalue. - Also make sure it is not valid as an null pointer constant. */ +/* Return an expr equal to X but certainly not valid as an lvalue. */ tree non_lvalue (x) @@ -1694,18 +1693,7 @@ non_lvalue (x) || TREE_CODE (x) == REAL_CST || TREE_CODE (x) == STRING_CST || TREE_CODE (x) == ADDR_EXPR) - { - if (TREE_CODE (x) == INTEGER_CST && integer_zerop (x)) - { - /* Use NOP_EXPR instead of NON_LVALUE_EXPR - so convert_for_assignment won't strip it. - This is so this 0 won't be treated as a null pointer constant. */ - result = build1 (NOP_EXPR, TREE_TYPE (x), x); - TREE_CONSTANT (result) = TREE_CONSTANT (x); - return result; - } - return x; - } + return x; result = build1 (NON_LVALUE_EXPR, TREE_TYPE (x), x); TREE_CONSTANT (result) = TREE_CONSTANT (x); @@ -6060,7 +6048,7 @@ fold (expr) return t; /* Don't let (0, 0) be null pointer constant. */ if (integer_zerop (arg1)) - return non_lvalue (arg1); + return build1 (NOP_EXPR, TREE_TYPE (arg1), arg1); return arg1; case COMPLEX_EXPR: |