Commit fc76e425 by Richard Stallman

(default_conversion, build_binary_op, build_function_call): Use STRIP_NOPS.

From-SVN: r1534
parent d964285c
...@@ -889,9 +889,8 @@ default_conversion (exp) ...@@ -889,9 +889,8 @@ default_conversion (exp)
type = TREE_TYPE (exp); type = TREE_TYPE (exp);
} }
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ /* Strip NON_LVALUE_EXPRs, etc., since we aren't using as an lvalue. */
if (TREE_CODE (exp) == NON_LVALUE_EXPR) STRIP_NOPS (exp);
exp = TREE_OPERAND (exp, 0);
/* Normally convert enums to int, /* Normally convert enums to int,
but convert wide enums to something wider. */ but convert wide enums to something wider. */
...@@ -1774,9 +1773,8 @@ build_function_call (function, params) ...@@ -1774,9 +1773,8 @@ build_function_call (function, params)
register tree coerced_params; register tree coerced_params;
tree name = NULL_TREE; tree name = NULL_TREE;
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ /* Strip NON_LVALUE_EXPRs, etc., since we aren't using as an lvalue. */
if (TREE_CODE (function) == NON_LVALUE_EXPR) STRIP_NOPS (function);
function = TREE_OPERAND (function, 0);
/* Convert anything with function type to a pointer-to-function. */ /* Convert anything with function type to a pointer-to-function. */
if (TREE_CODE (function) == FUNCTION_DECL) if (TREE_CODE (function) == FUNCTION_DECL)
...@@ -1907,6 +1905,8 @@ convert_arguments (typelist, values, name) ...@@ -1907,6 +1905,8 @@ convert_arguments (typelist, values, name)
} }
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
/* Do not use STRIP_NOPS here! We do not want an enumerator with value 0
to convert automatically to a pointer. */
if (TREE_CODE (val) == NON_LVALUE_EXPR) if (TREE_CODE (val) == NON_LVALUE_EXPR)
val = TREE_OPERAND (val, 0); val = TREE_OPERAND (val, 0);
...@@ -2225,11 +2225,9 @@ build_binary_op (code, orig_op0, orig_op1, convert_p) ...@@ -2225,11 +2225,9 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
code0 = TREE_CODE (type0); code0 = TREE_CODE (type0);
code1 = TREE_CODE (type1); code1 = TREE_CODE (type1);
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ /* Strip NON_LVALUE_EXPRs, etc., since we aren't using as an lvalue. */
if (TREE_CODE (op0) == NON_LVALUE_EXPR) STRIP_NOPS (op0);
op0 = TREE_OPERAND (op0, 0); STRIP_NOPS (op1);
if (TREE_CODE (op1) == NON_LVALUE_EXPR)
op1 = TREE_OPERAND (op1, 0);
/* If an error was already reported for one of the arguments, /* If an error was already reported for one of the arguments,
avoid reporting another error. */ avoid reporting another error. */
...@@ -3761,6 +3759,8 @@ build_modify_expr (lhs, modifycode, rhs) ...@@ -3761,6 +3759,8 @@ build_modify_expr (lhs, modifycode, rhs)
return error_mark_node; return error_mark_node;
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
/* Do not use STRIP_NOPS here. We do not want an enumerator
whose value is 0 to count as a null pointer constant. */
if (TREE_CODE (rhs) == NON_LVALUE_EXPR) if (TREE_CODE (rhs) == NON_LVALUE_EXPR)
rhs = TREE_OPERAND (rhs, 0); rhs = TREE_OPERAND (rhs, 0);
...@@ -3920,6 +3920,8 @@ convert_for_assignment (type, rhs, errtype, funname, parmnum) ...@@ -3920,6 +3920,8 @@ convert_for_assignment (type, rhs, errtype, funname, parmnum)
register enum tree_code coder; register enum tree_code coder;
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
/* Do not use STRIP_NOPS here. We do not want an enumerator
whose value is 0 to count as a null pointer constant. */
if (TREE_CODE (rhs) == NON_LVALUE_EXPR) if (TREE_CODE (rhs) == NON_LVALUE_EXPR)
rhs = TREE_OPERAND (rhs, 0); rhs = TREE_OPERAND (rhs, 0);
...@@ -4507,6 +4509,8 @@ digest_init (type, init, tail, require_constant, constructor_constant, ofwhat) ...@@ -4507,6 +4509,8 @@ digest_init (type, init, tail, require_constant, constructor_constant, ofwhat)
return init; return init;
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
/* Do not use STRIP_NOPS here. We do not want an enumerator
whose value is 0 to count as a null pointer constant. */
if (TREE_CODE (init) == NON_LVALUE_EXPR) if (TREE_CODE (init) == NON_LVALUE_EXPR)
inside_init = TREE_OPERAND (init, 0); inside_init = TREE_OPERAND (init, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment