+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.
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 {
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;
+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.
--- /dev/null
+// PR tree-optimization/59355
+// { dg-do compile }
+// { dg-options "-O2 -fno-devirtualize" }
+
+struct S
+{
+ virtual void bar ();
+};
+
+void
+foo (S *s)
+{
+ s->bar ();
+}