[Bug bootstrap/81033] [8 Regression] Revision r249019 breaks bootstrap on darwin

hubicka at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 3 10:19:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81033

--- Comment #8 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
We discussed this on IRC some time ago. The problem is that bb partitioning
seems broken on Darwin. Until the mentioned revision only -fprofile-use enabled
it and thus the bug probably went unnoticed because no-one tests
profiledbootstrap on darwin.

bb-partitioning was developed by apple years ago, so it used to work on Darwin.
it would be useful to figure out what broke and if we can fix it.  Without any
further analysis we would need to simply disable it as follows:

Index: darwin.c
===================================================================
--- darwin.c    (revision 249872)
+++ darwin.c    (working copy)
@@ -3146,29 +3146,9 @@
       && !TARGET_64BIT)
     global_options.x_flag_asynchronous_unwind_tables = 0;

-   /* Disable -freorder-blocks-and-partition when unwind tables are being
-      emitted for Darwin < 9 (OSX 10.5).
-      The strategy is, "Unless the User has specifically set/unset an unwind
-      flag we will switch off -freorder-blocks-and-partition when unwind
tables
-      will be generated".  If the User specifically sets flags... we assume
-      (s)he knows why...  */
-   if (generating_for_darwin_version < 9
-       && global_options_set.x_flag_reorder_blocks_and_partition
-       && ((global_options.x_flag_exceptions           /* User, c++, java */
-           && !global_options_set.x_flag_exceptions)   /* User specified... */
-          || (global_options.x_flag_unwind_tables
-              && !global_options_set.x_flag_unwind_tables)
-          || (global_options.x_flag_non_call_exceptions
-              && !global_options_set.x_flag_non_call_exceptions)
-          || (global_options.x_flag_asynchronous_unwind_tables
-              && !global_options_set.x_flag_asynchronous_unwind_tables)))
-    {
-      inform (input_location,
-             "-freorder-blocks-and-partition does not work with exceptions "
-             "on this architecture");
-      flag_reorder_blocks_and_partition = 0;
-      flag_reorder_blocks = 1;
-    }
+  /* Disable flag_reorder_blocks_and_partition as it is broken on Darwin.
+     See PR 81033.  */
+  flag_reorder_blocks_and_partition = 0;

     /* FIXME: flag_objc_sjlj_exceptions is no longer needed since there is
only
        one valid choice of exception scheme for each runtime.  */


Looking into the error I suppose problem is:
___cold_sect_of_allocate:
__ZN9__gnu_cxx16bitmap_allocatorIcE8allocateEmPKv.cold.42:

and bit later

___cold_sect_of_allocate:
__ZN9__gnu_cxx16bitmap_allocatorIwE8allocateEm.cold.47:

So perhaps the following fix it?
Index: darwin.c
===================================================================
--- darwin.c    (revision 249872)
+++ darwin.c    (working copy)
@@ -3685,7 +3665,7 @@
 {
   char buf[128];
   snprintf (buf, 128, "%s%s",new_is_cold?"__cold_sect_of_":"__hot_sect_of_",
-           IDENTIFIER_POINTER (DECL_NAME (decl)));
+           IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
   /* Make sure we pick up all the relevant quotes etc.  */
   assemble_name_raw (fp, (const char *) buf);
   fputs (":\n", fp);


More information about the Gcc-bugs mailing list