Restrict IPA split (PR go/63560).
authorJan Hubicka <hubicka@ucw.cz>
Fri, 8 Mar 2019 12:37:54 +0000 (13:37 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Fri, 8 Mar 2019 12:37:54 +0000 (12:37 +0000)
2019-03-08  Jan Hubicka  <hubicka@ucw.cz>

PR go/63560
* ipa-split.c (execute_split_functions): Do not split
'noinline' or 'section' function.

From-SVN: r269491

gcc/ChangeLog
gcc/ipa-split.c

index f56b266..de7bdde 100644 (file)
@@ -1,3 +1,9 @@
+2019-03-08  Jan Hubicka  <hubicka@ucw.cz>
+
+       PR go/63560
+       * ipa-split.c (execute_split_functions): Do not split
+       'noinline' or 'section' function.
+
 2019-03-08  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/79846
index cfd03ab..5eaf825 100644 (file)
@@ -104,6 +104,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-pretty-print.h"
 #include "ipa-fnsummary.h"
 #include "cfgloop.h"
+#include "attribs.h"
 
 /* Per basic block info.  */
 
@@ -1751,6 +1752,20 @@ execute_split_functions (void)
       return 0;
     }
 
+  if (lookup_attribute ("noinline", DECL_ATTRIBUTES (current_function_decl)))
+    {
+      if (dump_file)
+       fprintf (dump_file, "Not splitting: function is noinline.\n");
+      return 0;
+    }
+  if (lookup_attribute ("section", DECL_ATTRIBUTES (current_function_decl)))
+    {
+      if (dump_file)
+       fprintf (dump_file, "Not splitting: function is in user defined "
+                "section.\n");
+      return 0;
+    }
+
   /* We enforce splitting after loop headers when profile info is not
      available.  */
   if (profile_status_for_fn (cfun) != PROFILE_READ)