diff mbox

Fix c6x unwinding info

Message ID 201110031657.45178.paul@codesourcery.com
State New
Headers show

Commit Message

Paul Brook Oct. 3, 2011, 3:57 p.m. UTC
Patch below makes gcc emit the resuired assembly directives for c6x unwinding 
tables, same as ARM and IA64.  This fixes most of the unwinding related 
failures.

Tested on c6x-elf

Ok?

Paul

2011-10-03  Paul Brook  <paul@codesourcery.com>

	* config/c6x/c6x.c (c6x_asm_emit_except_personality,
	c6x_asm_init_sections): New functions.
	(TARGET_ASM_EMIT_EXCEPT_PERSONALITY, TARGET_ASM_INIT_SECTIONS):
	Define.

Comments

Bernd Schmidt Oct. 3, 2011, 4:43 p.m. UTC | #1
On 10/03/11 17:57, Paul Brook wrote:
> Patch below makes gcc emit the resuired assembly directives for c6x unwinding 
> tables, same as ARM and IA64.  This fixes most of the unwinding related 
> failures.

Most?

> 	* config/c6x/c6x.c (c6x_asm_emit_except_personality,
> 	c6x_asm_init_sections): New functions.
> 	(TARGET_ASM_EMIT_EXCEPT_PERSONALITY, TARGET_ASM_INIT_SECTIONS):
> 	Define.

Ok.


Bernd
Paul Brook Oct. 3, 2011, 5:26 p.m. UTC | #2
> On 10/03/11 17:57, Paul Brook wrote:
> > Patch below makes gcc emit the resuired assembly directives for c6x
> > unwinding tables, same as ARM and IA64.  This fixes most of the
> > unwinding related failures.
> 
> Most?

There are a number of failures in g++.dg/torture/stackalign which appear to be 
EH related.  I'm still investigating the exact cause.

Paul
Bernd Schmidt Oct. 21, 2011, 9:04 p.m. UTC | #3
On 10/03/11 17:57, Paul Brook wrote:
> 2011-10-03  Paul Brook  <paul@codesourcery.com>
> 
> 	* config/c6x/c6x.c (c6x_asm_emit_except_personality,
> 	c6x_asm_init_sections): New functions.
> 	(TARGET_ASM_EMIT_EXCEPT_PERSONALITY, TARGET_ASM_INIT_SECTIONS):
> 	Define.

This was also never applied. I've committed it.


Bernd
diff mbox

Patch

Index: gcc/config/c6x/c6x.c
===================================================================
--- gcc/config/c6x/c6x.c	(revision 179178)
+++ gcc/config/c6x/c6x.c	(working copy)
@@ -5625,6 +5625,26 @@  c6x_debug_unwind_info (void)
 
   return default_debug_unwind_info ();
 }
+
+/* Implement TARGET_ASM_EMIT_EXCEPT_PERSONALITY.  */
+
+static void
+c6x_asm_emit_except_personality (rtx personality)
+{
+  fputs ("\t.personality\t", asm_out_file);
+  output_addr_const (asm_out_file, personality);
+  fputc ('\n', asm_out_file);
+}
+
+/* Use a special assembly directive rather than a regular setion for
+   unwind table data.  */
+
+static void
+c6x_asm_init_sections (void)
+{
+  exception_section = get_unnamed_section (0, output_section_asm_op,
+					   "\t.handlerdata");
+}
 
 /* Target Structure.  */
 
@@ -5769,6 +5789,12 @@  c6x_debug_unwind_info (void)
 #undef TARGET_ARM_EABI_UNWINDER
 #define TARGET_ARM_EABI_UNWINDER true
 
+#undef TARGET_ASM_EMIT_EXCEPT_PERSONALITY
+#define TARGET_ASM_EMIT_EXCEPT_PERSONALITY c6x_asm_emit_except_personality
+
+#undef TARGET_ASM_INIT_SECTIONS
+#define TARGET_ASM_INIT_SECTIONS c6x_asm_init_sections
+
 #undef TARGET_DEBUG_UNWIND_INFO
 #define TARGET_DEBUG_UNWIND_INFO  c6x_debug_unwind_info