diff options
author | Olga Golovanevsky <olga@il.ibm.com> | 2007-03-17 12:47:53 +0000 |
---|---|---|
committer | Olga Golovanevsky <olga@gcc.gnu.org> | 2007-03-17 12:47:53 +0000 |
commit | 44d974b5d205b10a3f4636de4fa9c4a2198b3a10 (patch) | |
tree | 8a38484be2bd881bb6c654baad0af82a2f18595e /gcc | |
parent | 604e4ce3fe1f97b4c4952dae38b734db76491c1b (diff) | |
download | gcc-44d974b5d205b10a3f4636de4fa9c4a2198b3a10.zip gcc-44d974b5d205b10a3f4636de4fa9c4a2198b3a10.tar.gz gcc-44d974b5d205b10a3f4636de4fa9c4a2198b3a10.tar.bz2 |
ipa-type-escape fix for ada
From-SVN: r123022
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ipa-type-escape.c | 35 |
2 files changed, 20 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 68d32e3..a6beced 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-03-17 Olga Golovanevsky <olga@il.ibm.com> + + * ipa-type-escape.c (look_for_casts) : Revert code to use + handled_component_p due to ada test a-numaux.adb. + 2007-03-17 Kazu Hirata <kazu@codesourcery.com> * final.c (final_scan_insn): Alter the condition of a diff --git a/gcc/ipa-type-escape.c b/gcc/ipa-type-escape.c index d4c86ca..921284d 100644 --- a/gcc/ipa-type-escape.c +++ b/gcc/ipa-type-escape.c @@ -1239,26 +1239,21 @@ look_for_casts (tree lhs ATTRIBUTE_UNUSED, tree t) tree castfromvar = TREE_OPERAND (t, 0); cast = cast | 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); - cast = cast | 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); + cast = cast | check_cast (TREE_TYPE (t), castfromref); + } + else if (TREE_CODE (t) == COMPONENT_REF) + get_canon_type (TREE_TYPE (TREE_OPERAND (t, 1)), false, false); + } if (!cast) cast = CT_NO_CAST; |