http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #18 from Iain Sandoe <iains at gcc dot gnu.org> 2010-12-14 12:17:00 
UTC ---
(In reply to comment #17)
> > well.... the pre-existing implementation of :
> > 
> > static section *
> > darwin_text_section (int reloc, int weak)
> > {
> >   if (reloc)
> >     return (weak
> >         ? darwin_sections[text_unlikely_coal_section]
> >         : unlikely_text_section ());  <<<<<<<<+++++++++
> >   else
> >     return (weak
> >         ? darwin_sections[text_coal_section]
> >         : text_section);
> > }
> > 
> > ...  is invoked when darwin_function_section () returns NULL.
> The code probably should also disable itself with -fno-reorder-functions...

well, this also fixes the issue .. 

but, the original implementation of darwin_text_section () pre-dates my
involvement 
-- I am not sure why it partitions, and ...
--  if we should preserve some partitioning even when the option is off ... 

Mike?

Index: gcc/opts.c
===================================================================
--- gcc/opts.c    (revision 167793)
+++ gcc/opts.c    (working copy)
@@ -723,6 +723,9 @@ finish_options (struct gcc_options *opts, struct g
       opts->x_flag_reorder_blocks = 1;
     }

+  if (opts->x_flag_reorder_blocks_and_partition)
+    opts->x_flag_reorder_blocks = 1;
+
   /* If user requested unwind info, then turn off the partitioning
      optimization.  */

Index: gcc/config/darwin.c
===================================================================
--- gcc/config/darwin.c    (revision 167793)
+++ gcc/config/darwin.c    (working copy)
@@ -1147,7 +1147,7 @@ darwin_mark_decl_preserved (const char *name)
 static section *
 darwin_text_section (int reloc, int weak)
 {
-  if (reloc)
+  if (flag_reorder_functions && reloc)
     return (weak
         ? darwin_sections[text_unlikely_coal_section]
         : unlikely_text_section ());

Reply via email to