+2005-03-20 Joseph S. Myers <joseph@codesourcery.com>
+
+ * c-common.c (check_case_value): Adjust comment about stripping
+ NOPs.
+ (handle_vector_size_attribute): Don't strip NON_LVALUE_EXPR.
+ * c-typeck.c (default_conversion, convert_arguments,
+ build_modify_expr, convert_for_assignment, store_init_value,
+ digest_init): Use STRIP_TYPE_NOPS instead of stripping nops
+ manually. Remove inaccurate comments.
+
2005-03-20 Roger Sayle <roger@eyesopen.com>
Joseph S. Myers <joseph@codesourcery.com>
if (value == NULL_TREE)
return value;
- /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
+ /* ??? Can we ever get nops here for a valid case value? We
+ shouldn't for C. */
STRIP_TYPE_NOPS (value);
/* In C++, the following is allowed:
*no_add_attrs = true;
- /* Stripping NON_LVALUE_EXPR allows declarations such as
- typedef short v4si __attribute__((vector_size (4 * sizeof(short)))). */
size = TREE_VALUE (args);
- if (TREE_CODE (size) == NON_LVALUE_EXPR)
- size = TREE_OPERAND (size, 0);
if (!host_integerp (size, 1))
{
type = TREE_TYPE (exp);
}
- /* Strip NON_LVALUE_EXPRs and no-op conversions, since we aren't using as
- an lvalue.
-
- Do not use STRIP_NOPS here! It will remove conversions from pointer
- to integer and cause infinite recursion. */
+ /* Strip no-op conversions. */
orig_exp = exp;
- while (TREE_CODE (exp) == NON_LVALUE_EXPR
- || (TREE_CODE (exp) == NOP_EXPR
- && TREE_TYPE (TREE_OPERAND (exp, 0)) == TREE_TYPE (exp)))
- exp = TREE_OPERAND (exp, 0);
+ STRIP_TYPE_NOPS (exp);
if (TREE_NO_WARNING (orig_exp))
TREE_NO_WARNING (exp) = 1;
argnum -= 2;
}
- /* 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)
- val = TREE_OPERAND (val, 0);
+ STRIP_TYPE_NOPS (val);
val = default_function_array_conversion (val);
if (TREE_CODE (lhs) == ERROR_MARK || TREE_CODE (rhs) == ERROR_MARK)
return error_mark_node;
- /* 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)
- rhs = TREE_OPERAND (rhs, 0);
+ STRIP_TYPE_NOPS (rhs);
newrhs = rhs;
} \
} while (0)
- /* 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)
- rhs = TREE_OPERAND (rhs, 0);
+ STRIP_TYPE_NOPS (rhs);
if (TREE_CODE (TREE_TYPE (rhs)) == ARRAY_TYPE
|| TREE_CODE (TREE_TYPE (rhs)) == FUNCTION_TYPE)
{
tree inside_init = init;
- if (TREE_CODE (init) == NON_LVALUE_EXPR)
- inside_init = TREE_OPERAND (init, 0);
+ STRIP_TYPE_NOPS (inside_init);
inside_init = fold (inside_init);
if (TREE_CODE (inside_init) == COMPOUND_LITERAL_EXPR)
|| TREE_TYPE (init) == error_mark_node)
return error_mark_node;
- /* 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)
- inside_init = TREE_OPERAND (init, 0);
+ STRIP_TYPE_NOPS (inside_init);
inside_init = fold (inside_init);