Commit dd82a6c6 by Jan Hubicka Committed by Jan Hubicka

* ipa-type-escape.c (look_for_casts): Revamp using handled_component_p.

From-SVN: r120849
parent 30fd45a0
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> 2007-01-17 Eric Christopher <echristo@apple.com>
* config.gcc: Support core2 processor. * config.gcc: Support core2 processor.
......
...@@ -920,26 +920,21 @@ look_for_casts (tree lhs __attribute__((unused)), tree t) ...@@ -920,26 +920,21 @@ look_for_casts (tree lhs __attribute__((unused)), tree t)
tree castfromvar = TREE_OPERAND (t, 0); tree castfromvar = TREE_OPERAND (t, 0);
check_cast (TREE_TYPE (t), castfromvar); check_cast (TREE_TYPE (t), castfromvar);
} }
else if (TREE_CODE (t) == COMPONENT_REF else
|| TREE_CODE (t) == INDIRECT_REF while (handled_component_p (t))
|| TREE_CODE (t) == BIT_FIELD_REF) {
{ t = TREE_OPERAND (t, 0);
tree base = get_base_address (t); if (TREE_CODE (t) == VIEW_CONVERT_EXPR)
while (t != base) {
{ /* This may be some part of a component ref.
t = TREE_OPERAND (t, 0); IE it may be a.b.VIEW_CONVERT_EXPR<weird_type>(c).d, AFAIK.
if (TREE_CODE (t) == VIEW_CONVERT_EXPR) castfromref will give you a.b.c, not a. */
{ tree castfromref = TREE_OPERAND (t, 0);
/* This may be some part of a component ref. check_cast (TREE_TYPE (t), castfromref);
IE it may be a.b.VIEW_CONVERT_EXPR<weird_type>(c).d, AFAIK. }
castfromref will give you a.b.c, not a. */ else if (TREE_CODE (t) == COMPONENT_REF)
tree castfromref = TREE_OPERAND (t, 0); get_canon_type (TREE_TYPE (TREE_OPERAND (t, 1)), false, false);
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 /* Check to see if T is a read or address of operation on a static var
......
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