diff options
author | Jan Hubicka <jh@suse.cz> | 2013-08-26 17:42:10 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2013-08-26 15:42:10 +0000 |
commit | d6d989fc197ee6387bfd2e0ea2652ff69d1f61bc (patch) | |
tree | 4093212bff3d2e016c64a9d39fb1965093fd30a6 /gcc | |
parent | 2aa3da06e03332d488613e98b4f1f523117ecce5 (diff) | |
download | gcc-d6d989fc197ee6387bfd2e0ea2652ff69d1f61bc.zip gcc-d6d989fc197ee6387bfd2e0ea2652ff69d1f61bc.tar.gz gcc-d6d989fc197ee6387bfd2e0ea2652ff69d1f61bc.tar.bz2 |
cgraph.c (cgraph_propagate_frequency): Do not assume that virtual methods can not be called indirectly when...
* cgraph.c (cgraph_propagate_frequency): Do not assume that virtual
methods can not be called indirectly when their address is not taken.
From-SVN: r202003
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cgraph.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 29a8d55..f296c37 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2013-08-26 Jan Hubicka <jh@suse.cz> + * cgraph.c (cgraph_propagate_frequency): Do not assume that virtual + methods can not be called indirectly when their address is not taken. + +2013-08-26 Jan Hubicka <jh@suse.cz> + * gimple-fold.c (gimple_get_virt_method_for_binfo): Use ctor_for_folding. 2013-08-26 Jan Hubicka <jh@suse.cz> diff --git a/gcc/cgraph.c b/gcc/cgraph.c index efd30ab..063c524 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -2348,7 +2348,10 @@ cgraph_propagate_frequency (struct cgraph_node *node) struct cgraph_propagate_frequency_data d = {true, true, true, true}; bool changed = false; - if (!node->local.local) + /* We can not propagate anything useful about externally visible functions + nor about virtuals. */ + if (!node->local.local + || (flag_devirtualize && DECL_VIRTUAL_P (node->symbol.decl))) return false; gcc_assert (node->symbol.analyzed); if (dump_file && (dump_flags & TDF_DETAILS)) |