summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1998-08-13 16:12:55 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1998-08-13 16:12:55 +0000
commit84791d69ad65cc2c14fbebe7f3f2b3953c56e843 (patch)
treea6ff7c8e7d25278a337f2dcc9679eaa22d0df471 /gcc/fold-const.c
parenta609ffbc44221d213de05b9a4e9d6b2470639313 (diff)
downloadgcc-84791d69ad65cc2c14fbebe7f3f2b3953c56e843.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@21698 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 4fe68994454..c84d52c9724 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: