diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-08-02 12:01:10 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-08-02 12:01:10 +0000 |
commit | e26f0e952250791d788cb964e1eaac069f4d12d3 (patch) | |
tree | 9f5c9390485625e2058261714dca8ac762d401b3 /gcc | |
parent | 7b3cf6ac470ca73492c6471710de11068e67f6f7 (diff) | |
download | gcc-e26f0e952250791d788cb964e1eaac069f4d12d3.tar.gz |
(expand_expr, case PLACEHOLDER_EXPR): Find innermost matching and
don't check contains_placeholder_p.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14605 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/expr.c | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index 41deddfd2c0..9f5ad573792 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -5023,36 +5023,28 @@ expand_expr (exp, target, tmode, modifier) tree old_list = placeholder_list; tree elt; - /* See if the object is the type that we want and does not contain - this PLACEHOLDER_EXPR itself. Then see if the operand of any - reference is the type we want. */ + /* See if the object is the type that we want. */ if ((TYPE_MAIN_VARIANT (TREE_TYPE (TREE_PURPOSE (placeholder_list))) - == need_type) - && (! contains_this_placeholder_p - (TREE_PURPOSE (placeholder_list), exp))) + == need_type)) object = TREE_PURPOSE (placeholder_list); - else - /* Find the outermost reference that is of the type we want and - that does not itself contain this PLACEHOLDER_EXPR. */ - for (elt = TREE_PURPOSE (placeholder_list); - elt != 0 - && (TREE_CODE_CLASS (TREE_CODE (elt)) == 'r' - || TREE_CODE_CLASS (TREE_CODE (elt)) == '1' - || TREE_CODE_CLASS (TREE_CODE (elt)) == '2' - || TREE_CODE_CLASS (TREE_CODE (elt)) == 'e'); - elt = ((TREE_CODE (elt) == COMPOUND_EXPR - || TREE_CODE (elt) == COND_EXPR) - ? TREE_OPERAND (elt, 1) : TREE_OPERAND (elt, 0))) - if (TREE_CODE_CLASS (TREE_CODE (elt)) == 'r' - && (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; - } + /* Find the innermost reference that is of the type we want. */ + for (elt = TREE_PURPOSE (placeholder_list); + elt != 0 + && (TREE_CODE_CLASS (TREE_CODE (elt)) == 'r' + || TREE_CODE_CLASS (TREE_CODE (elt)) == '1' + || TREE_CODE_CLASS (TREE_CODE (elt)) == '2' + || TREE_CODE_CLASS (TREE_CODE (elt)) == 'e'); + elt = ((TREE_CODE (elt) == COMPOUND_EXPR + || TREE_CODE (elt) == COND_EXPR) + ? TREE_OPERAND (elt, 1) : TREE_OPERAND (elt, 0))) + if (TREE_CODE_CLASS (TREE_CODE (elt)) == 'r' + && (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (elt, 0))) + == need_type)) + { + object = TREE_OPERAND (elt, 0); + break; + } if (object != 0) { |