typeck.c (build_array_ref): Push the array reference inside COMPOUND_EXPR and COND_EXPR.
* typeck.c (build_array_ref): Push the array reference inside COMPOUND_EXPR and COND_EXPR. From-SVN: r41223
This commit is contained in:
parent
c050ec51a4
commit
0450d74d53
@ -1,3 +1,8 @@
|
|||||||
|
2001-04-10 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
|
* typeck.c (build_array_ref): Push the array reference inside
|
||||||
|
COMPOUND_EXPR and COND_EXPR.
|
||||||
|
|
||||||
2001-04-05 Mark Mitchell <mark@codesourcery.com>
|
2001-04-05 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
* cp-tree.h (DECL_THIS_INLINE): Rename to DECL_DECLARED_INLINE_P.
|
* cp-tree.h (DECL_THIS_INLINE): Rename to DECL_DECLARED_INLINE_P.
|
||||||
|
@ -2433,6 +2433,27 @@ build_array_ref (array, idx)
|
|||||||
|| TREE_TYPE (idx) == error_mark_node)
|
|| TREE_TYPE (idx) == error_mark_node)
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
|
|
||||||
|
/* If ARRAY is a COMPOUND_EXPR or COND_EXPR, move our reference
|
||||||
|
inside it. */
|
||||||
|
switch (TREE_CODE (array))
|
||||||
|
{
|
||||||
|
case COMPOUND_EXPR:
|
||||||
|
{
|
||||||
|
tree value = build_array_ref (TREE_OPERAND (array, 1), idx);
|
||||||
|
return build (COMPOUND_EXPR, TREE_TYPE (value),
|
||||||
|
TREE_OPERAND (array, 0), value);
|
||||||
|
}
|
||||||
|
|
||||||
|
case COND_EXPR:
|
||||||
|
return build_conditional_expr
|
||||||
|
(TREE_OPERAND (array, 0),
|
||||||
|
build_array_ref (TREE_OPERAND (array, 1), idx),
|
||||||
|
build_array_ref (TREE_OPERAND (array, 2), idx));
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE
|
if (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE
|
||||||
&& TREE_CODE (array) != INDIRECT_REF)
|
&& TREE_CODE (array) != INDIRECT_REF)
|
||||||
{
|
{
|
||||||
@ -2469,6 +2490,7 @@ build_array_ref (array, idx)
|
|||||||
if (mark_addressable (array) == 0)
|
if (mark_addressable (array) == 0)
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* An array that is indexed by a constant value which is not within
|
/* An array that is indexed by a constant value which is not within
|
||||||
the array bounds cannot be stored in a register either; because we
|
the array bounds cannot be stored in a register either; because we
|
||||||
would get a crash in store_bit_field/extract_bit_field when trying
|
would get a crash in store_bit_field/extract_bit_field when trying
|
||||||
|
Loading…
Reference in New Issue
Block a user