Hi,
this patch enables -fdeclone-ctor-dtor by default: I believe it is up to the
optimizers to decide when the actual worker body should be inlined into the
thunks.

Bootstrapped/regtested x86_64-linux, OK?

Honza

        * c-family/c.opt: Enable declonning by default.
        * c-family/c-opts.c: Do not enable decloning for -Os.
        * doc/invoke.texi (-fdeclone-ctor-dtor): Update documentation.
Index: c-family/c.opt
===================================================================
--- c-family/c.opt      (revision 210521)
+++ c-family/c.opt      (working copy)
@@ -904,7 +904,7 @@ C++ ObjC++ Var(flag_deduce_init_list) In
 -fdeduce-init-list     enable deduction of std::initializer_list for a 
template type parameter from a brace-enclosed initializer-list
 
 fdeclone-ctor-dtor
-C++ ObjC++ Var(flag_declone_ctor_dtor) Init(-1)
+C++ ObjC++ Var(flag_declone_ctor_dtor) Init(1)
 Factor complex constructors and destructors to favor space over speed
 
 fdefault-inline
Index: c-family/c-opts.c
===================================================================
--- c-family/c-opts.c   (revision 210521)
+++ c-family/c-opts.c   (working copy)
@@ -906,10 +906,6 @@ c_common_post_options (const char **pfil
   if (warn_implicit_function_declaration == -1)
     warn_implicit_function_declaration = flag_isoc99;
 
-  /* Declone C++ 'structors if -Os.  */
-  if (flag_declone_ctor_dtor == -1)
-    flag_declone_ctor_dtor = optimize_size;
-
   if (cxx_dialect >= cxx11)
     {
       /* If we're allowing C++0x constructs, don't warn about C++98
Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi     (revision 210521)
+++ doc/invoke.texi     (working copy)
@@ -7413,7 +7414,7 @@ clones, which means two copies of the fu
 base and complete variants are changed to be thunks that call a common
 implementation.
 
-Enabled by @option{-Os}.
+Enabled by default.
 
 @item -fdelete-null-pointer-checks
 @opindex fdelete-null-pointer-checks

Reply via email to