diff options
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ipa-devirt.c | 6 | ||||
-rw-r--r-- | gcc/opts.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ipa/pr59355.C | 14 |
5 files changed, 31 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0e947b7..92a8651 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-12-04 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/59355 + * ipa-devirt.c (gate_ipa_devirt): Return false if + !flag_devirtualize. + * opts.c (common_handle_option): Fix comment spelling. + 2013-12-04 Yufeng Zhang <yufeng.zhang@arm.com> * gimple-ssa-strength-reduction.c: Include tree-affine.h. diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index 4c4e7a5..7452828 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -1591,12 +1591,14 @@ ipa_devirt (void) return ndevirtualized ? TODO_remove_functions : 0; } -/* Gate for IPCP optimization. */ +/* Gate for speculative IPA devirtualization optimization. */ static bool gate_ipa_devirt (void) { - return flag_devirtualize_speculatively && optimize; + return (flag_devirtualize + && flag_devirtualize_speculatively + && optimize); } namespace { @@ -1709,7 +1709,7 @@ common_handle_option (struct gcc_options *opts, if (!opts_set->x_flag_tree_loop_distribute_patterns) opts->x_flag_tree_loop_distribute_patterns = value; /* Indirect call profiling should do all useful transformations - speculative devirutalization does. */ + speculative devirtualization does. */ if (!opts_set->x_flag_devirtualize_speculatively && opts->x_flag_value_profile_transformations) opts->x_flag_devirtualize_speculatively = false; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dcc02b5..e358541 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-12-04 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/59355 + * g++.dg/ipa/pr59355.C: New test. + 2013-12-04 Yufeng Zhang <yufeng.zhang@arm.com> * gcc.dg/tree-ssa/slsr-39.c: Update. diff --git a/gcc/testsuite/g++.dg/ipa/pr59355.C b/gcc/testsuite/g++.dg/ipa/pr59355.C new file mode 100644 index 0000000..907c6d7 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr59355.C @@ -0,0 +1,14 @@ +// PR tree-optimization/59355 +// { dg-do compile } +// { dg-options "-O2 -fno-devirtualize" } + +struct S +{ + virtual void bar (); +}; + +void +foo (S *s) +{ + s->bar (); +} |