Commit dcb7c3ce by Richard Kenner

(expand_expr...

(expand_expr, case PLACEHOLDER_EXPR): Pick outermost object in
placeholder_list of right type without a PLACEHOLDER_EXPR.

From-SVN: r14498
parent 3910a7cb
...@@ -5048,26 +5048,36 @@ expand_expr (exp, target, tmode, modifier) ...@@ -5048,26 +5048,36 @@ expand_expr (exp, target, tmode, modifier)
tree old_list = placeholder_list; tree old_list = placeholder_list;
tree elt; tree elt;
/* See if the object is the type that we want. Then see if /* See if the object is the type that we want and does not contain
the operand of any reference is the type we want. */ this PLACEHOLDER_EXPR itself. Then see if the operand of any
reference is the type we want. */
if ((TYPE_MAIN_VARIANT (TREE_TYPE (TREE_PURPOSE (placeholder_list))) if ((TYPE_MAIN_VARIANT (TREE_TYPE (TREE_PURPOSE (placeholder_list)))
== need_type)) == need_type)
&& (! contains_this_placeholder_p
(TREE_PURPOSE (placeholder_list), exp)))
object = TREE_PURPOSE (placeholder_list); object = TREE_PURPOSE (placeholder_list);
/* Find the innermost reference that is of the type we want. */ else
for (elt = TREE_PURPOSE (placeholder_list); /* Find the outermost reference that is of the type we want and
elt != 0 that does not itself contain this PLACEHOLDER_EXPR. */
&& (TREE_CODE_CLASS (TREE_CODE (elt)) == 'r' for (elt = TREE_PURPOSE (placeholder_list);
|| TREE_CODE_CLASS (TREE_CODE (elt)) == '1' elt != 0
|| TREE_CODE_CLASS (TREE_CODE (elt)) == '2' && (TREE_CODE_CLASS (TREE_CODE (elt)) == 'r'
|| TREE_CODE_CLASS (TREE_CODE (elt)) == 'e'); || TREE_CODE_CLASS (TREE_CODE (elt)) == '1'
elt = ((TREE_CODE (elt) == COMPOUND_EXPR || TREE_CODE_CLASS (TREE_CODE (elt)) == '2'
|| TREE_CODE (elt) == COND_EXPR) || TREE_CODE_CLASS (TREE_CODE (elt)) == 'e');
? TREE_OPERAND (elt, 1) : TREE_OPERAND (elt, 0))) elt = ((TREE_CODE (elt) == COMPOUND_EXPR
if (TREE_CODE_CLASS (TREE_CODE (elt)) == 'r' || TREE_CODE (elt) == COND_EXPR)
&& (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (elt, 0))) ? TREE_OPERAND (elt, 1) : TREE_OPERAND (elt, 0)))
== need_type)) if (TREE_CODE_CLASS (TREE_CODE (elt)) == 'r'
object = TREE_OPERAND (elt, 0); && (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (elt, 0)))
== need_type)
&& ! contains_this_placeholder_p (TREE_OPERAND (elt, 0),
exp))
{
object = TREE_OPERAND (elt, 0);
break;
}
if (object != 0) if (object != 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