varasm.c (default_function_section): Check flag_reorder_functions and targetm.have_na...
authorJan Hubicka <jh@suse.cz>
Sun, 12 Dec 2010 19:12:08 +0000 (20:12 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 12 Dec 2010 19:12:08 +0000 (19:12 +0000)
* varasm.c (default_function_section): Check flag_reorder_functions
and targetm.have_named_sections.
* config/darwin.c (darwin_function_section): Check
flag_reorder_functions.

Co-Authored-By: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
From-SVN: r167727

gcc/ChangeLog
gcc/config/darwin.c
gcc/varasm.c

index ca7b49da7c45ee6b49faa4db2a0d7fbb197d3756..73329a8c3abcd9a387204f12e9e2c12e367c4d2b 100644 (file)
@@ -1,3 +1,11 @@
+2010-12-12  Jan Hubicka  <jh@suse.cz>
+           Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * varasm.c (default_function_section): Check flag_reorder_functions
+       and targetm.have_named_sections.
+       * config/darwin.c (darwin_function_section): Check
+       flag_reorder_functions.
+
 2010-12-12  Finn Thain  <fthain@telegraphics.com.au>
 
        PR target/46179
index 93621acea79ca944c620cac6ccd3eff79d78cdd7..8ae6409bcee74255cfb6fea3ebe0f5c8c883950c 100644 (file)
@@ -2968,6 +2968,8 @@ section *
 darwin_function_section (tree decl, enum node_frequency freq,
                          bool startup, bool exit)
 {
+  if (!flag_reorder_functions)
+    return NULL;
   /* Startup code should go to startup subsection unless it is
      unlikely executed (this happens especially with function splitting
      where we can split away unnecesary parts of static constructors.  */
index da494d69ad8607f547aba912a04feb34a0e3f444..891d4e06e572738a0006c8f62edd0d1ed2e83274 100644 (file)
@@ -533,6 +533,9 @@ section *
 default_function_section (tree decl, enum node_frequency freq,
                          bool startup, bool exit)
 {
+  if (!flag_reorder_functions
+      || !targetm.have_named_sections)
+    return NULL;
   /* Startup code should go to startup subsection unless it is
      unlikely executed (this happens especially with function splitting
      where we can split away unnecesary parts of static constructors.  */