aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 898f394..27934dd 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -1862,8 +1862,7 @@ min_precision (tree value, int unsignedp)
}
/* Print an error message for invalid operands to arith operation
- CODE. NOP_EXPR is used as a special case (see
- c_common_truthvalue_conversion). */
+ CODE. */
void
binary_op_error (enum tree_code code)
@@ -1872,10 +1871,6 @@ binary_op_error (enum tree_code code)
switch (code)
{
- case NOP_EXPR:
- error ("invalid truth-value expression");
- return;
-
case PLUS_EXPR:
opname = "+"; break;
case MINUS_EXPR:
@@ -2467,13 +2462,12 @@ c_common_truthvalue_conversion (tree expr)
c_common_truthvalue_conversion (TREE_OPERAND (expr, 2)));
case CONVERT_EXPR:
+ case NOP_EXPR:
/* Don't cancel the effect of a CONVERT_EXPR from a REFERENCE_TYPE,
since that affects how `default_conversion' will behave. */
if (TREE_CODE (TREE_TYPE (expr)) == REFERENCE_TYPE
|| TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == REFERENCE_TYPE)
break;
- /* Fall through.... */
- case NOP_EXPR:
/* If this is widening the argument, we can ignore it. */
if (TYPE_PRECISION (TREE_TYPE (expr))
>= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (expr, 0))))
@@ -5614,7 +5608,9 @@ check_function_arguments_recurse (void (*callback)
void *ctx, tree param,
unsigned HOST_WIDE_INT param_num)
{
- if (TREE_CODE (param) == NOP_EXPR)
+ if ((TREE_CODE (param) == NOP_EXPR || TREE_CODE (param) == CONVERT_EXPR)
+ && (TYPE_PRECISION (TREE_TYPE (param))
+ == TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (param, 0)))))
{
/* Strip coercion. */
check_function_arguments_recurse (callback, ctx,