aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/arm/arm.c58
-rw-r--r--gcc/config/arm/arm.h16
-rw-r--r--gcc/config/arm/bpabi.h3
-rw-r--r--gcc/config/ia64/ia64.c46
-rw-r--r--gcc/config/ia64/ia64.h8
-rw-r--r--gcc/config/pa/pa.c2
6 files changed, 91 insertions, 42 deletions
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 44cbc8e..2ff010b 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -193,12 +193,13 @@ static bool arm_align_anon_bitfield (void);
static bool arm_return_in_msb (const_tree);
static bool arm_must_pass_in_stack (enum machine_mode, const_tree);
static bool arm_return_in_memory (const_tree, const_tree);
-#ifdef TARGET_UNWIND_INFO
+#if ARM_UNWIND_INFO
static void arm_unwind_emit (FILE *, rtx);
static bool arm_output_ttype (rtx);
static void arm_asm_emit_except_personality (rtx);
static void arm_asm_init_sections (void);
#endif
+static enum unwind_info_type arm_except_unwind_info (void);
static void arm_dwarf_handle_frame_unspec (const char *, rtx, int);
static rtx arm_dwarf_register_span (rtx);
@@ -461,7 +462,7 @@ static const struct attribute_spec arm_attribute_table[] =
#undef TARGET_MUST_PASS_IN_STACK
#define TARGET_MUST_PASS_IN_STACK arm_must_pass_in_stack
-#ifdef TARGET_UNWIND_INFO
+#if ARM_UNWIND_INFO
#undef TARGET_ASM_UNWIND_EMIT
#define TARGET_ASM_UNWIND_EMIT arm_unwind_emit
@@ -477,7 +478,10 @@ static const struct attribute_spec arm_attribute_table[] =
#undef TARGET_ASM_INIT_SECTIONS
#define TARGET_ASM_INIT_SECTIONS arm_asm_init_sections
-#endif /* TARGET_UNWIND_INFO */
+#endif /* ARM_UNWIND_INFO */
+
+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO arm_except_unwind_info
#undef TARGET_DWARF_HANDLE_FRAME_UNSPEC
#define TARGET_DWARF_HANDLE_FRAME_UNSPEC arm_dwarf_handle_frame_unspec
@@ -2032,7 +2036,7 @@ arm_compute_func_type (void)
if (optimize > 0
&& (TREE_NOTHROW (current_function_decl)
|| !(flag_unwind_tables
- || (flag_exceptions && !USING_SJLJ_EXCEPTIONS)))
+ || (flag_exceptions && arm_except_unwind_info () != UI_SJLJ)))
&& TREE_THIS_VOLATILE (current_function_decl))
type |= ARM_FT_VOLATILE;
@@ -15719,7 +15723,8 @@ arm_expand_prologue (void)
using the EABI unwinder, to prevent faulting instructions from being
swapped with a stack adjustment. */
if (crtl->profile || !TARGET_SCHED_PROLOG
- || (ARM_EABI_UNWIND_TABLES && cfun->can_throw_non_call_exceptions))
+ || (arm_except_unwind_info () == UI_TARGET
+ && cfun->can_throw_non_call_exceptions))
emit_insn (gen_blockage ());
/* If the link register is being kept alive, with the return address in it,
@@ -19575,7 +19580,7 @@ thumb_pushpop (FILE *f, unsigned long mask, int push, int *cfa_offset,
return;
}
- if (ARM_EABI_UNWIND_TABLES && push)
+ if (push && arm_except_unwind_info () == UI_TARGET)
{
fprintf (f, "\t.save\t{");
for (regno = 0; regno < 15; regno++)
@@ -20515,7 +20520,8 @@ thumb1_expand_prologue (void)
using the EABI unwinder, to prevent faulting instructions from being
swapped with a stack adjustment. */
if (crtl->profile || !TARGET_SCHED_PROLOG
- || (ARM_EABI_UNWIND_TABLES && cfun->can_throw_non_call_exceptions))
+ || (arm_except_unwind_info () == UI_TARGET
+ && cfun->can_throw_non_call_exceptions))
emit_insn (gen_blockage ());
cfun->machine->lr_save_eliminated = !thumb_force_lr_save ();
@@ -20628,7 +20634,7 @@ thumb1_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
if (crtl->args.pretend_args_size)
{
/* Output unwind directive for the stack adjustment. */
- if (ARM_EABI_UNWIND_TABLES)
+ if (arm_except_unwind_info () == UI_TARGET)
fprintf (f, "\t.pad #%d\n",
crtl->args.pretend_args_size);
@@ -20698,7 +20704,7 @@ thumb1_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
work_register = thumb_find_work_register (live_regs_mask);
- if (ARM_EABI_UNWIND_TABLES)
+ if (arm_except_unwind_info () == UI_TARGET)
asm_fprintf (f, "\t.pad #16\n");
asm_fprintf
@@ -22061,7 +22067,7 @@ arm_dwarf_register_span (rtx rtl)
return p;
}
-#ifdef TARGET_UNWIND_INFO
+#if ARM_UNWIND_INFO
/* Emit unwind directives for a store-multiple instruction or stack pointer
push during alignment.
These should only ever be generated by the function prologue code, so
@@ -22275,7 +22281,7 @@ arm_unwind_emit (FILE * asm_out_file, rtx insn)
{
rtx pat;
- if (!ARM_EABI_UNWIND_TABLES)
+ if (arm_except_unwind_info () != UI_TARGET)
return;
if (!(flag_unwind_tables || crtl->uses_eh_lsda)
@@ -22344,7 +22350,33 @@ arm_asm_init_sections (void)
exception_section = get_unnamed_section (0, output_section_asm_op,
"\t.handlerdata");
}
-#endif /* TARGET_UNWIND_INFO */
+#endif /* ARM_UNWIND_INFO */
+
+/* Implement TARGET_EXCEPT_UNWIND_INFO. */
+
+static enum unwind_info_type
+arm_except_unwind_info (void)
+{
+ /* Honor the --enable-sjlj-exceptions configure switch. */
+#ifdef CONFIG_SJLJ_EXCEPTIONS
+ if (CONFIG_SJLJ_EXCEPTIONS)
+ return UI_SJLJ;
+#endif
+
+ /* If not using ARM EABI unwind tables... */
+ if (ARM_UNWIND_INFO)
+ {
+ /* For simplicity elsewhere in this file, indicate that all unwind
+ info is disabled if we're not emitting unwind tables. */
+ if (!flag_exceptions && !flag_unwind_tables)
+ return UI_NONE;
+ else
+ return UI_TARGET;
+ }
+
+ /* ... we use sjlj exceptions for backwards compatibility. */
+ return UI_SJLJ;
+}
/* Handle UNSPEC DWARF call frame instructions. These are needed for dynamic
@@ -22376,7 +22408,7 @@ arm_dwarf_handle_frame_unspec (const char *label, rtx pattern, int index)
void
arm_output_fn_unwind (FILE * f, bool prologue)
{
- if (!ARM_EABI_UNWIND_TABLES)
+ if (arm_except_unwind_info () != UI_TARGET)
return;
if (prologue)
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 9bd1c69..9bbe346 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -948,14 +948,11 @@ extern int arm_structure_size_boundary;
#define FIRST_HI_REGNUM 8
#define LAST_HI_REGNUM 11
-#ifndef TARGET_UNWIND_INFO
-/* We use sjlj exceptions for backwards compatibility. */
-#define MUST_USE_SJLJ_EXCEPTIONS 1
+/* Overridden by config/arm/bpabi.h. */
+#ifndef ARM_UNWIND_INFO
+#define ARM_UNWIND_INFO 0
#endif
-/* We can generate DWARF2 Unwind info, even though we don't use it. */
-#define DWARF2_UNWIND_INFO 1
-
/* Use r0 and r1 to pass exception handling information. */
#define EH_RETURN_DATA_REGNO(N) (((N) < 2) ? N : INVALID_REGNUM)
@@ -2033,13 +2030,6 @@ typedef struct
#define ARM_OUTPUT_FN_UNWIND(F, PROLOGUE) arm_output_fn_unwind (F, PROLOGUE)
-#ifdef TARGET_UNWIND_INFO
-#define ARM_EABI_UNWIND_TABLES \
- ((!USING_SJLJ_EXCEPTIONS && flag_exceptions) || flag_unwind_tables)
-#else
-#define ARM_EABI_UNWIND_TABLES 0
-#endif
-
/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
and check its validity for a certain class.
We have two alternate definitions for each of them.
diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h
index c6cdca4..9a59b47 100644
--- a/gcc/config/arm/bpabi.h
+++ b/gcc/config/arm/bpabi.h
@@ -26,7 +26,8 @@
#define TARGET_BPABI (TARGET_AAPCS_BASED)
/* BPABI targets use EABI frame unwinding tables. */
-#define TARGET_UNWIND_INFO 1
+#undef ARM_UNWIND_INFO
+#define ARM_UNWIND_INFO 1
/* Section 4.1 of the AAPCS requires the use of VFP format. */
#undef FPUTYPE_DEFAULT
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 61be5a4..f75e42b 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -251,6 +251,9 @@ static void ia64_asm_unwind_emit (FILE *, rtx);
static void ia64_asm_emit_except_personality (rtx);
static void ia64_asm_init_sections (void);
+static enum unwind_info_type ia64_debug_unwind_info (void);
+static enum unwind_info_type ia64_except_unwind_info (void);
+
static struct bundle_state *get_free_bundle_state (void);
static void free_bundle_state (struct bundle_state *);
static void initiate_bundle_states (void);
@@ -537,6 +540,11 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_ASM_INIT_SECTIONS
#define TARGET_ASM_INIT_SECTIONS ia64_asm_init_sections
+#undef TARGET_DEBUG_UNWIND_INFO
+#define TARGET_DEBUG_UNWIND_INFO ia64_debug_unwind_info
+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO ia64_except_unwind_info
+
#undef TARGET_SCALAR_MODE_SUPPORTED_P
#define TARGET_SCALAR_MODE_SUPPORTED_P ia64_scalar_mode_supported_p
#undef TARGET_VECTOR_MODE_SUPPORTED_P
@@ -3903,7 +3911,7 @@ ia64_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
current_frame_info.n_output_regs,
current_frame_info.n_rotate_regs);
- if (!flag_unwind_tables && (!flag_exceptions || USING_SJLJ_EXCEPTIONS))
+ if (ia64_except_unwind_info () != UI_TARGET)
return;
/* Emit the .prologue directive. */
@@ -3961,7 +3969,7 @@ ia64_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
static void
ia64_output_function_end_prologue (FILE *file)
{
- if (!flag_unwind_tables && (!flag_exceptions || USING_SJLJ_EXCEPTIONS))
+ if (ia64_except_unwind_info () != UI_TARGET)
return;
fputs ("\t.body\n", file);
@@ -8558,7 +8566,7 @@ ia64_add_bundle_selector_before (int template0, rtx insn)
ia64_emit_insn_before (b, insn);
#if NR_BUNDLES == 10
if ((template0 == 4 || template0 == 5)
- && (flag_unwind_tables || (flag_exceptions && !USING_SJLJ_EXCEPTIONS)))
+ && ia64_except_unwind_info () == UI_TARGET)
{
int i;
rtx note = NULL_RTX;
@@ -9399,7 +9407,7 @@ ia64_reorg (void)
/* A call must not be the last instruction in a function, so that the
return address is still within the function, so that unwinding works
properly. Note that IA-64 differs from dwarf2 on this point. */
- if (flag_unwind_tables || (flag_exceptions && !USING_SJLJ_EXCEPTIONS))
+ if (ia64_except_unwind_info () == UI_TARGET)
{
rtx insn;
int saw_stop = 0;
@@ -9865,8 +9873,7 @@ process_cfa_offset (FILE *asm_out_file, rtx pat, bool unwind)
static void
ia64_asm_unwind_emit (FILE *asm_out_file, rtx insn)
{
- bool unwind = (flag_unwind_tables
- || (flag_exceptions && !USING_SJLJ_EXCEPTIONS));
+ bool unwind = ia64_except_unwind_info () == UI_TARGET;
bool frame = dwarf2out_do_frame ();
rtx note, pat;
bool handled_one;
@@ -9991,6 +9998,33 @@ ia64_asm_init_sections (void)
exception_section = get_unnamed_section (0, output_section_asm_op,
"\t.handlerdata");
}
+
+/* Implement TARGET_DEBUG_UNWIND_INFO. */
+
+static enum unwind_info_type
+ia64_debug_unwind_info (void)
+{
+ return UI_TARGET;
+}
+
+/* Implement TARGET_EXCEPT_UNWIND_INFO. */
+
+static enum unwind_info_type
+ia64_except_unwind_info (void)
+{
+ /* Honor the --enable-sjlj-exceptions configure switch. */
+#ifdef CONFIG_UNWIND_EXCEPTIONS
+ if (CONFIG_UNWIND_EXCEPTIONS)
+ return UI_SJLJ;
+#endif
+
+ /* For simplicity elsewhere in this file, indicate that all unwind
+ info is disabled if we're not emitting unwind tables. */
+ if (!flag_exceptions && !flag_unwind_tables)
+ return UI_NONE;
+
+ return UI_TARGET;
+}
enum ia64_builtins
{
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index dbb5ebd..98e9b64 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1731,12 +1731,6 @@ do { \
#define DWARF2_DEBUGGING_INFO 1
-/* We do not want call-frame info to be output, since debuggers are
- supposed to use the target unwind info. Leave this undefined it
- TARGET_UNWIND_INFO might ever be false. */
-
-#define DWARF2_FRAME_INFO 0
-
#define DWARF2_ASM_LINE_DEBUG_INFO (TARGET_DWARF2_ASM)
/* Use tags for debug info labels, so that they don't break instruction
@@ -1849,8 +1843,6 @@ do { \
extern int ia64_final_schedule;
-#define TARGET_UNWIND_INFO 1
-
#define TARGET_UNWIND_TABLES_DEFAULT true
#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 15 : INVALID_REGNUM)
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 754d27a..43da019 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -520,7 +520,7 @@ pa_option_override (void)
call frame information. There is no benefit in using this optimization
on PA8000 and later processors. */
if (pa_cpu >= PROCESSOR_8000
- || (! USING_SJLJ_EXCEPTIONS && flag_exceptions)
+ || (targetm.except_unwind_info () == UI_DWARF2 && flag_exceptions)
|| flag_unwind_tables)
target_flags &= ~MASK_JUMP_IN_DELAY;