diff options
author | Jan Hubicka <jh@suse.cz> | 2007-01-17 12:16:24 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2007-01-17 11:16:24 +0000 |
commit | dd82a6c6f6f3f8caaee608dbd385314865bd900c (patch) | |
tree | 9eb8867a840351a7283be605bf4a6970572e0c31 | |
parent | 30fd45a0b2c2bffc8b7999f4da9f7bfbac97fead (diff) | |
download | gcc-dd82a6c6f6f3f8caaee608dbd385314865bd900c.zip gcc-dd82a6c6f6f3f8caaee608dbd385314865bd900c.tar.gz gcc-dd82a6c6f6f3f8caaee608dbd385314865bd900c.tar.bz2 |
* ipa-type-escape.c (look_for_casts): Revamp using handled_component_p.
From-SVN: r120849
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ipa-type-escape.c | 35 |
2 files changed, 19 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d87295d..4045c4b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2007-01-17 Jan Hubicka <jh@suse.cz> + + * ipa-type-escape.c (look_for_casts): Revamp using handled_component_p. + 2007-01-17 Eric Christopher <echristo@apple.com> * config.gcc: Support core2 processor. diff --git a/gcc/ipa-type-escape.c b/gcc/ipa-type-escape.c index 7b2fac1..ccb6010 100644 --- a/gcc/ipa-type-escape.c +++ b/gcc/ipa-type-escape.c @@ -920,26 +920,21 @@ look_for_casts (tree lhs __attribute__((unused)), tree t) tree castfromvar = TREE_OPERAND (t, 0); check_cast (TREE_TYPE (t), castfromvar); } - else if (TREE_CODE (t) == COMPONENT_REF - || TREE_CODE (t) == INDIRECT_REF - || TREE_CODE (t) == BIT_FIELD_REF) - { - tree base = get_base_address (t); - while (t != base) - { - t = TREE_OPERAND (t, 0); - if (TREE_CODE (t) == VIEW_CONVERT_EXPR) - { - /* This may be some part of a component ref. - IE it may be a.b.VIEW_CONVERT_EXPR<weird_type>(c).d, AFAIK. - castfromref will give you a.b.c, not a. */ - tree castfromref = TREE_OPERAND (t, 0); - check_cast (TREE_TYPE (t), castfromref); - } - else if (TREE_CODE (t) == COMPONENT_REF) - get_canon_type (TREE_TYPE (TREE_OPERAND (t, 1)), false, false); - } - } + else + while (handled_component_p (t)) + { + t = TREE_OPERAND (t, 0); + if (TREE_CODE (t) == VIEW_CONVERT_EXPR) + { + /* This may be some part of a component ref. + IE it may be a.b.VIEW_CONVERT_EXPR<weird_type>(c).d, AFAIK. + castfromref will give you a.b.c, not a. */ + tree castfromref = TREE_OPERAND (t, 0); + check_cast (TREE_TYPE (t), castfromref); + } + else if (TREE_CODE (t) == COMPONENT_REF) + get_canon_type (TREE_TYPE (TREE_OPERAND (t, 1)), false, false); + } } /* Check to see if T is a read or address of operation on a static var |