This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][Revised5] Fix PR41313 with dual approach


This revised patch restores the original behavior on Darwin before
r150553 by disabling -freorder-blocks-and-partition whenever
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/msg01275.html
http://gcc.gnu.org/ml/gcc-testresults/2009-10/msg01308.html

The patch eliminates the failing for the g++.dg/tree-prof test cases
in both cases except for excessive compile errors that are harmless
which cause false failures in the test cases...

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


2009-10-12  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
        when darwin_emit_unwind_label is used.

Index: gcc/config/darwin.c
===================================================================
--- gcc/config/darwin.c	(revision 152694)
+++ gcc/config/darwin.c	(working copy)
@@ -1697,6 +1697,16 @@
   if (dwarf_strict < 0) 
     dwarf_strict = 1;
 
+  /* Disable -freorder-blocks-and-partition for darwin_emit_unwind_label.  */
+  if (flag_reorder_blocks_and_partition 
+      && (targetm.asm_out.unwind_label == darwin_emit_unwind_label))
+    {
+      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 152694)
+++ 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]