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]

Re: [PATCH][Revised] Fix PR41313 by restoring original conditional logic for darwin


On Sat, Oct 03, 2009 at 11:18:50AM +0200, Jakub Jelinek wrote:
> 
> If you want to fix this issue, you should really either fix it properly,
> i.e. find out why darwin emits those symbols at all, think about how it
> should work with hot/cold partitioning, adjusting the unwind_label hook
> so that it is passed whether it is the first or second FDE and doing
> something sensible on the darwin side with it.
> 

Actually there may be a middle way here. Mike Stump pointed out
earlier that when targeting 10.6, these .eh labels no longer
are necessary. I've verified this although you do get a few
false failures in the testsuite due to noisy non-fatal compiler
warnings. Since Apple hasn't leveraged this ability to drop the
.eh labels in their compilers yet, this shouldn't be surprising
and likely just merit some radar reports on their linker.
   So we could use a hybrid fix where the hack...

Index: opts.c
===================================================================
--- opts.c      (revision 152432)
+++ opts.c      (working copy)
@@ -1039,6 +1039,7 @@
 
   if (flag_exceptions && flag_reorder_blocks_and_partition
       && (USING_SJLJ_EXCEPTIONS
+      || (targetm.asm_out.unwind_label != default_emit_unwind_label)
 #ifdef TARGET_UNWIND_INFO
          || 1
 #endif
@@ -1056,6 +1057,7 @@
   if (flag_unwind_tables && ! targetm.unwind_tables_default
       && flag_reorder_blocks_and_partition
       && (USING_SJLJ_EXCEPTIONS
+      || (targetm.asm_out.unwind_label != default_emit_unwind_label)
 #ifdef TARGET_UNWIND_INFO
          || 1
 #endif
@@ -1075,6 +1077,7 @@
       && (!targetm.have_named_sections
          || (flag_unwind_tables && targetm.unwind_tables_default
              && (USING_SJLJ_EXCEPTIONS
+             || (targetm.asm_out.unwind_label != default_emit_unwind_label)
 #ifdef TARGET_UNWIND_INFO
                  || 1
 #endif

is used to disable hot/cold partitioning on darwin, but this behavior is
avoided when targeting 10.6 with something like...

if (darwin_macosx_version_min && strverscmp (darwin_macosx_version_min, "10.6") >= 0)
       targetm.asm_out.unwind_label = default_emit_unwind_label;

in darwin_override_options() of gcc/config/darwin.c. I haven't quite puzzled out
if that would be sufficient to override the settings that occur from the
TARGET_ASM_EMIT_UNWIND_LABEL define in darwin.h.
      Jack

> Or, as a temporary hack, you could perhaps forcefully disable
> flag_reorder_blocks_and_partition in opts.c if
> targetm.asm_out.unwind_label != default_emit_unwind_label.
> 
> 	Jakub


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