diff options
author | Martin Jambor <mjambor@suse.cz> | 2011-01-15 00:19:08 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2011-01-15 00:19:08 +0100 |
commit | 05842ff57c6eb899ffb7bfd6624634f5aa4df878 (patch) | |
tree | 59421812ee885d513e8c87c7fb099f042a10672d /gcc/ipa-prop.c | |
parent | f65cf2b706151e0310518eef48bab95cf8155c3c (diff) | |
download | gcc-05842ff57c6eb899ffb7bfd6624634f5aa4df878.zip gcc-05842ff57c6eb899ffb7bfd6624634f5aa4df878.tar.gz gcc-05842ff57c6eb899ffb7bfd6624634f5aa4df878.tar.bz2 |
common.opt (fdevirtualize): New flag.
2011-01-15 Martin Jambor <mjambor@suse.cz>
* common.opt (fdevirtualize): New flag.
* doc/invoke.texi (Option Summary): Document it.
* opts.c (default_options_table): Add devirtualize flag.
* ipa-prop.c (detect_type_change): Return immediately if
devirtualize flag is not set.
(detect_type_change_ssa): Likewise.
(compute_known_type_jump_func): Likewise.
(ipa_analyze_virtual_call_uses): Likewise.
From-SVN: r168826
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r-- | gcc/ipa-prop.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index fd67221..1970881 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -456,7 +456,7 @@ detect_type_change (tree arg, tree base, gimple call, || handled_component_p (arg)); /* Const calls cannot call virtual methods through VMT and so type changes do not matter. */ - if (!gimple_vuse (call)) + if (!flag_devirtualize || !gimple_vuse (call)) return false; tci.type_maybe_changed = false; @@ -486,7 +486,8 @@ static bool detect_type_change_ssa (tree arg, gimple call, struct ipa_jump_func *jfunc) { gcc_checking_assert (TREE_CODE (arg) == SSA_NAME); - if (!POINTER_TYPE_P (TREE_TYPE (arg)) + if (!flag_devirtualize + || !POINTER_TYPE_P (TREE_TYPE (arg)) || TREE_CODE (TREE_TYPE (TREE_TYPE (arg))) != RECORD_TYPE) return false; @@ -689,7 +690,8 @@ compute_known_type_jump_func (tree op, struct ipa_jump_func *jfunc, HOST_WIDE_INT offset, size, max_size; tree base, binfo; - if (TREE_CODE (op) != ADDR_EXPR + if (!flag_devirtualize + || TREE_CODE (op) != ADDR_EXPR || TREE_CODE (TREE_TYPE (TREE_TYPE (op))) != RECORD_TYPE) return; @@ -1378,6 +1380,9 @@ ipa_analyze_virtual_call_uses (struct cgraph_node *node, tree var; int index; + if (!flag_devirtualize) + return; + if (TREE_CODE (obj) == ADDR_EXPR) { do |