summaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>1998-08-13 12:12:55 -0400
committerJason Merrill <jason@gcc.gnu.org>1998-08-13 12:12:55 -0400
commitff59bfe6b2ea13d9bb6171a43a5957e03a73901f (patch)
treea6ff7c8e7d25278a337f2dcc9679eaa22d0df471 /gcc/expr.c
parent0d906a5f369e6c35c32c7f5489dd4027c823973e (diff)
downloadgcc-ff59bfe6b2ea13d9bb6171a43a5957e03a73901f.tar.gz
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/expr.c')
-rw-r--r--gcc/expr.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 208db5cb2d8..7f1b35f859e 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4983,13 +4983,19 @@ safe_from_p (x, exp, top_p)
if (save_expr_count >= save_expr_size)
return 0;
save_expr_rewritten[save_expr_count++] = exp;
- TREE_SET_CODE (exp, ERROR_MARK);
nops = tree_code_length[(int) SAVE_EXPR];
for (i = 0; i < nops; i++)
- if (TREE_OPERAND (exp, i) != 0
- && ! safe_from_p (x, TREE_OPERAND (exp, i), 0))
- return 0;
+ {
+ tree operand = TREE_OPERAND (exp, i);
+ if (operand == NULL_TREE)
+ continue;
+ TREE_SET_CODE (exp, ERROR_MARK);
+ if (!safe_from_p (x, operand, 0))
+ return 0;
+ TREE_SET_CODE (exp, SAVE_EXPR);
+ }
+ TREE_SET_CODE (exp, ERROR_MARK);
return 1;
case BIND_EXPR: