Patchwork [SEH] Tidy calls to output_function_exception_table

login
register
mail settings
Submitter Richard Henderson
Date Sept. 7, 2010, 9:49 p.m.
Message ID <4C86B35F.3020806@redhat.com>
Download mbox | patch
Permalink /patch/64075/
State New
Headers show

Comments

Richard Henderson - Sept. 7, 2010, 9:49 p.m.
This removes a gratuitous ifdef on TARGET_UNWIND_INFO.

Putting the data before assemble_end_function is required for
the various targets that actually define TARGET_UNWIND_INFO;
putting the data after assemble_end_function doesn't really
matter for dwarf2/sjlj exceptions.

I plan to entirely remove the TARGET_UNWIND_INFO macro, and
this is one step.

Tested on x86_64-w64-mingw32 (with other patches), crosses to
ia64 and arm-eabi, and a sanity check on x86_64-linux.


r~

Patch

diff --git a/gcc/final.c b/gcc/final.c
index 06ebc17..79cd85e 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -4240,19 +4240,13 @@  rest_of_handle_final (void)
   final (get_insns (), asm_out_file, optimize);
   final_end_function ();
 
-#ifdef TARGET_UNWIND_INFO
-  /* ??? The IA-64 ".handlerdata" directive must be issued before
-     the ".endp" directive that closes the procedure descriptor.  */
+  /* The IA-64 ".handlerdata" directive must be issued before the ".endp"
+     directive that closes the procedure descriptor.  Similarly, for x64 SEH.
+     Otherwise it's not strictly necessary, but it doesn't hurt either.  */
   output_function_exception_table (fnname);
-#endif
 
   assemble_end_function (current_function_decl, fnname);
 
-#ifndef TARGET_UNWIND_INFO
-  /* Otherwise, it feels unclean to switch sections in the middle.  */
-  output_function_exception_table (fnname);
-#endif
-
   user_defined_section_attribute = false;
 
   /* Free up reg info memory.  */