[PATCH][Revised4] Fix PR41313 with dual approach

Jack Howarth howarth@bromo.med.uc.edu
Sun Oct 11 07:19:00 GMT 2009


On Sat, Oct 10, 2009 at 05:07:19PM -0400, Jack Howarth wrote:
> This revised patch restores the original pre-r150553 behavior on Darwin 
> by disabling -freorder-blocks-and-partition for exception handling
> and when unwind info is requested if darwin_emit_unwind_label is in use.
> The patch allows darwin10 to now use default_emit_unwind_label since
> eh labels are no longer needed under 10.6. Bootstrapped and regression tested 
> on x86_64-apple-darwin10 and x86_64-apple-darwin9...
> 
> http://gcc.gnu.org/ml/gcc-testresults/2009-10/msg01008.html
> http://gcc.gnu.org/ml/gcc-testresults/2009-10/msg00956.html
> 
> The patch eliminates the failures in the g++.dg/tree-prof test cases
> except for two excessive compile errors failures that are due to harmless 
> linker warnings in darwin10...
> 
> FAIL: g++.dg/tree-prof/partition1.C compilation,  -g  -fprofile-use
> UNRESOLVED: g++.dg/tree-prof/partition1.C execution,    -g  -fprofile-use
> FAIL: g++.dg/tree-prof/partition1.C compilation,  -O3 -g  -fprofile-use
> UNRESOLVED: g++.dg/tree-prof/partition1.C execution,    -O3 -g  -fprofile-use
> 
> on x86_64-apple-darwin10. Okay for gcc trunk?
>                Jack
> 
> 

Correction of two typos in the patch comments. Sorry about that.
               Jack
-------------- next part --------------
2009-10-10  Jack Howarth  <howarth@bromo.med.uc.edu>

        PR c++/41313
	* gcc/config/darwin10.h: Use default_emit_unwind_label.
        * gcc/config/darwin.c: Disable -freorder-blocks-and-partition
        on exception handling or requesting unwind info when
	darwin_emit_unwind_label is used.

Index: gcc/config/darwin.c
===================================================================
--- gcc/config/darwin.c	(revision 152583)
+++ gcc/config/darwin.c	(working copy)
@@ -1697,6 +1697,18 @@
   if (dwarf_strict < 0) 
     dwarf_strict = 1;
 
+  /* Disable -freorder-blocks-and-partition on exception handling or
+     requesting unwind info when darwin_emit_unwind_label is used.  */
+  if ((flag_reorder_blocks_and_partition 
+      && (targetm.asm_out.unwind_label == darwin_emit_unwind_label))
+          && (flag_exceptions || flag_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;
+    }
+
   if (flag_mkernel || flag_apple_kext)
     {
       /* -mkernel implies -fapple-kext for C++ */
Index: gcc/config/darwin10.h
===================================================================
--- gcc/config/darwin10.h	(revision 152583)
+++ gcc/config/darwin10.h	(working copy)
@@ -23,3 +23,8 @@
 
 #undef LIB_SPEC
 #define LIB_SPEC "%{!static:-no_compact_unwind -lSystem}"
+
+/* Unwind labels are no longer required in darwin10.  */
+
+#undef TARGET_ASM_EMIT_UNWIND_LABEL
+#define TARGET_ASM_EMIT_UNWIND_LABEL default_emit_unwind_label


More information about the Gcc-patches mailing list