]> gcc.gnu.org Git - gcc.git/commitdiff
Always set DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT correctly
authorAndi Kleen <ak@linux.intel.com>
Tue, 16 Sep 2014 03:22:41 +0000 (03:22 +0000)
committerAndi Kleen <ak@gcc.gnu.org>
Tue, 16 Sep 2014 03:22:41 +0000 (03:22 +0000)
When profiling is disabled force DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT
for each function to one. This information is then preserved
through LTO.

With this patch for LTO builds -pg needs to be set on both the
LTO final link and the original source build, to allow -pg
(or -pg -fentry) to be active for that source file. This allows
to build large projects mostly with -pg, except for a few files,
and still use LTO.

gcc/:

2014-09-15  Andi Kleen  <ak@linux.intel.com>

* function.c (allocate_struct_function): Force
DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT to one when
profiling is disabled.

From-SVN: r215284

gcc/ChangeLog
gcc/function.c

index 94f2d9cbf5c9a01ded39d9f3dda3918ae5e23c11..8d4f5ba1c372ec07db36b49b77bab2dad8139b56 100644 (file)
@@ -1,3 +1,9 @@
+2014-09-15  Andi Kleen  <ak@linux.intel.com>
+
+       * function.c (allocate_struct_function): Force
+       DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT to one when
+       profiling is disabled.
+
 2014-09-15  Trevor Saunders  <tsaunders@mozilla.com>
     
        * cfgrtl.c, combine.c, config/arc/arc.c, config/mcore/mcore.c,
index 26d25b9b4bf014eb3f4a305d717e4a3d836a0847..ac50f4af41abf0209c2463083869329f3e1e8448 100644 (file)
@@ -4555,6 +4555,9 @@ allocate_struct_function (tree fndecl, bool abstract_p)
          but is this worth the hassle?  */
       cfun->can_throw_non_call_exceptions = flag_non_call_exceptions;
       cfun->can_delete_dead_exceptions = flag_delete_dead_exceptions;
+
+      if (!profile_flag && !flag_instrument_function_entry_exit)
+       DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (fndecl) = 1;
     }
 }
 
This page took 0.111134 seconds and 5 git commands to generate.