aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-08-02 14:15:29 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1997-08-02 14:15:29 -0400
commitcff9c4079035e316a91d15586d83577270cb75a5 (patch)
tree254401e3dc411a4ab59801fde3ebebc0ae79d228
parent5a03c8c4016a7a702d6de2d308bca153a6befb5d (diff)
downloadgcc-cff9c4079035e316a91d15586d83577270cb75a5.zip
gcc-cff9c4079035e316a91d15586d83577270cb75a5.tar.gz
gcc-cff9c4079035e316a91d15586d83577270cb75a5.tar.bz2
(lvalue_p, case BIND_EXPR, RTL_EXPR): Return 1 if array.
From-SVN: r14626
-rw-r--r--gcc/c-typeck.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 32111d0..b3b0f10 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -1016,19 +1016,19 @@ default_conversion (exp)
if (TREE_CODE (exp) == COMPONENT_REF
&& DECL_BIT_FIELD (TREE_OPERAND (exp, 1)))
{
- tree width = DECL_SIZE (TREE_OPERAND (exp, 1));
- HOST_WIDE_INT low = TREE_INT_CST_LOW (width);
+ tree width = DECL_SIZE (TREE_OPERAND (exp, 1));
+ HOST_WIDE_INT low = TREE_INT_CST_LOW (width);
- /* If it's thinner than an int, promote it like a
- C_PROMOTING_INTEGER_TYPE_P, otherwise leave it alone. */
+ /* If it's thinner than an int, promote it like a
+ C_PROMOTING_INTEGER_TYPE_P, otherwise leave it alone. */
- if (low < TYPE_PRECISION (integer_type_node))
- {
- if ( flag_traditional && TREE_UNSIGNED (type))
- return convert (unsigned_type_node, exp);
- else
- return convert (integer_type_node, exp);
- }
+ if (low < TYPE_PRECISION (integer_type_node))
+ {
+ if (flag_traditional && TREE_UNSIGNED (type))
+ return convert (unsigned_type_node, exp);
+ else
+ return convert (integer_type_node, exp);
+ }
}
if (C_PROMOTING_INTEGER_TYPE_P (type))
@@ -1085,7 +1085,7 @@ default_conversion (exp)
TREE_OPERAND (exp, 0), op1);
}
- if (!lvalue_p (exp)
+ if (! lvalue_p (exp)
&& ! (TREE_CODE (exp) == CONSTRUCTOR && TREE_STATIC (exp)))
{
error ("invalid use of non-lvalue array");
@@ -3183,6 +3183,11 @@ lvalue_p (ref)
&& TREE_CODE (TREE_TYPE (ref)) != METHOD_TYPE)
return 1;
break;
+
+ case BIND_EXPR:
+ case RTL_EXPR:
+ if (TREE_CODE (TREE_TYPE (ref)) == ARRAY_TYPE)
+ return 1;
}
return 0;
}