gcc_options parameters.
* targhooks.c (default_except_unwind_info,
dwarf2_except_unwind_info, sjlj_except_unwind_info): Take
gcc_options parameters.
* targhooks.h (default_except_unwind_info,
dwarf2_except_unwind_info, sjlj_except_unwind_info): Update
prototypes.
* doc/tm.texi.in (TARGET_IRA_COVER_CLASSES,
TARGET_HAVE_NAMED_SECTIONS, TARGET_UNWIND_TABLES_DEFAULT):
Document that hooks must not be modified.
(TARGET_EXCEPT_UNWIND_INFO): Refer to opts argument.
* doc/tm.texi: Regenerate.
* defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Pass
&global_options to targetm.except_unwind_info.
* dwarf2out.c (dwarf2out_do_frame, dwarf2out_do_cfi_asm,
dwarf2out_begin_prologue, dwarf2out_frame_init,
dwarf2out_frame_finish, dwarf2out_assembly_start): Pass
&global_options to targetm.except_unwind_info.
* except.c (init_eh, finish_eh_generation,
gate_convert_to_eh_region_ranges,
output_one_function_exception_table): Pass &global_options to
targetm.except_unwind_info.
* expr.c (build_personality_function): Pass &global_options to
targetm.except_unwind_info.
* function.c (expand_function_end): Pass &global_options to
targetm.except_unwind_info.
* hooks.c (hook_bool_bool_gcc_optionsp_false): New.
* hooks.h (hook_bool_bool_gcc_optionsp_false): Declare.
* opts.c (finish_options): Pass opts to targetm.except_unwind_info
and targetm.supports_split_stack. Remove assertions about opts
and opts_set.
(common_handle_option): Remove assertions about opts, opts_set and
dc.
* tree-tailcall.c (suitable_for_tail_call_opt_p): Pass
&global_options to targetm.except_unwind_info.
* tree.c (build_common_builtin_nodes: Pass &global_options to
targetm.except_unwind_info.
* config/arm/arm.c (arm_except_unwind_info): Add gcc_options
parameter.
(arm_compute_func_type, arm_expand_prologue, thumb_pushpop,
thumb1_expand_prologue, thumb1_output_function_prologue,
arm_unwind_emit, arm_output_fn_unwind): Update calls to
arm_except_unwind_info.
* config/i386/i386.c (ix86_supports_split_stack): Add gcc_options
parameter.
* config/ia64/ia64.c (ia64_except_unwind_info): Add gcc_options
parameter.
(ia64_output_function_prologue, ia64_add_bundle_selector_before,
ia64_reorg, ia64_asm_unwind_emit): Update calls to
ia64_except_unwind_info.
* config/pa/pa.c (pa_option_override): Pass &global_options to
targetm.except_unwind_info.
* config/picochip/picochip-protos.h (picochip_except_unwind_info):
Remove prototype.
c-family:
* c-cppbuiltin.c (c_cpp_builtins): Pass &global_options to
targetm.except_unwind_info.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167145
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-11-25 Joseph Myers <joseph@codesourcery.com>
+
+ * target.def (supports_split_stack, except_unwind_info): Take
+ gcc_options parameters.
+ * targhooks.c (default_except_unwind_info,
+ dwarf2_except_unwind_info, sjlj_except_unwind_info): Take
+ gcc_options parameters.
+ * targhooks.h (default_except_unwind_info,
+ dwarf2_except_unwind_info, sjlj_except_unwind_info): Update
+ prototypes.
+ * doc/tm.texi.in (TARGET_IRA_COVER_CLASSES,
+ TARGET_HAVE_NAMED_SECTIONS, TARGET_UNWIND_TABLES_DEFAULT):
+ Document that hooks must not be modified.
+ (TARGET_EXCEPT_UNWIND_INFO): Refer to opts argument.
+ * doc/tm.texi: Regenerate.
+ * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Pass
+ &global_options to targetm.except_unwind_info.
+ * dwarf2out.c (dwarf2out_do_frame, dwarf2out_do_cfi_asm,
+ dwarf2out_begin_prologue, dwarf2out_frame_init,
+ dwarf2out_frame_finish, dwarf2out_assembly_start): Pass
+ &global_options to targetm.except_unwind_info.
+ * except.c (init_eh, finish_eh_generation,
+ gate_convert_to_eh_region_ranges,
+ output_one_function_exception_table): Pass &global_options to
+ targetm.except_unwind_info.
+ * expr.c (build_personality_function): Pass &global_options to
+ targetm.except_unwind_info.
+ * function.c (expand_function_end): Pass &global_options to
+ targetm.except_unwind_info.
+ * hooks.c (hook_bool_bool_gcc_optionsp_false): New.
+ * hooks.h (hook_bool_bool_gcc_optionsp_false): Declare.
+ * opts.c (finish_options): Pass opts to targetm.except_unwind_info
+ and targetm.supports_split_stack. Remove assertions about opts
+ and opts_set.
+ (common_handle_option): Remove assertions about opts, opts_set and
+ dc.
+ * tree-tailcall.c (suitable_for_tail_call_opt_p): Pass
+ &global_options to targetm.except_unwind_info.
+ * tree.c (build_common_builtin_nodes: Pass &global_options to
+ targetm.except_unwind_info.
+ * config/arm/arm.c (arm_except_unwind_info): Add gcc_options
+ parameter.
+ (arm_compute_func_type, arm_expand_prologue, thumb_pushpop,
+ thumb1_expand_prologue, thumb1_output_function_prologue,
+ arm_unwind_emit, arm_output_fn_unwind): Update calls to
+ arm_except_unwind_info.
+ * config/i386/i386.c (ix86_supports_split_stack): Add gcc_options
+ parameter.
+ * config/ia64/ia64.c (ia64_except_unwind_info): Add gcc_options
+ parameter.
+ (ia64_output_function_prologue, ia64_add_bundle_selector_before,
+ ia64_reorg, ia64_asm_unwind_emit): Update calls to
+ ia64_except_unwind_info.
+ * config/pa/pa.c (pa_option_override): Pass &global_options to
+ targetm.except_unwind_info.
+ * config/picochip/picochip-protos.h (picochip_except_unwind_info):
+ Remove prototype.
+
2010-11-25 Kai Tietz <kai.tietz@onevision.com>
* cgraphunit.c (process_function_and_variable_attributes):
+2010-11-25 Joseph Myers <joseph@codesourcery.com>
+
+ * c-cppbuiltin.c (c_cpp_builtins): Pass &global_options to
+ targetm.except_unwind_info.
+
2010-11-23 Joseph Myers <joseph@codesourcery.com>
* c-opts.c (c_common_handle_option): Pass location to
1000 + flag_abi_version);
/* libgcc needs to know this. */
- if (targetm.except_unwind_info () == UI_SJLJ)
+ if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
cpp_define (pfile, "__USING_SJLJ_EXCEPTIONS__");
/* limits.h and stdint.h need to know these. */
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 enum unwind_info_type arm_except_unwind_info (struct gcc_options *);
static void arm_dwarf_handle_frame_unspec (const char *, rtx, int);
static rtx arm_dwarf_register_span (rtx);
if (optimize > 0
&& (TREE_NOTHROW (current_function_decl)
|| !(flag_unwind_tables
- || (flag_exceptions && arm_except_unwind_info () != UI_SJLJ)))
+ || (flag_exceptions
+ && arm_except_unwind_info (&global_options) != UI_SJLJ)))
&& TREE_THIS_VOLATILE (current_function_decl))
type |= ARM_FT_VOLATILE;
using the EABI unwinder, to prevent faulting instructions from being
swapped with a stack adjustment. */
if (crtl->profile || !TARGET_SCHED_PROLOG
- || (arm_except_unwind_info () == UI_TARGET
+ || (arm_except_unwind_info (&global_options) == UI_TARGET
&& cfun->can_throw_non_call_exceptions))
emit_insn (gen_blockage ());
return;
}
- if (push && arm_except_unwind_info () == UI_TARGET)
+ if (push && arm_except_unwind_info (&global_options) == UI_TARGET)
{
fprintf (f, "\t.save\t{");
for (regno = 0; regno < 15; regno++)
using the EABI unwinder, to prevent faulting instructions from being
swapped with a stack adjustment. */
if (crtl->profile || !TARGET_SCHED_PROLOG
- || (arm_except_unwind_info () == UI_TARGET
+ || (arm_except_unwind_info (&global_options) == UI_TARGET
&& cfun->can_throw_non_call_exceptions))
emit_insn (gen_blockage ());
if (crtl->args.pretend_args_size)
{
/* Output unwind directive for the stack adjustment. */
- if (arm_except_unwind_info () == UI_TARGET)
+ if (arm_except_unwind_info (&global_options) == UI_TARGET)
fprintf (f, "\t.pad #%d\n",
crtl->args.pretend_args_size);
work_register = thumb_find_work_register (live_regs_mask);
- if (arm_except_unwind_info () == UI_TARGET)
+ if (arm_except_unwind_info (&global_options) == UI_TARGET)
asm_fprintf (f, "\t.pad #16\n");
asm_fprintf
{
rtx pat;
- if (arm_except_unwind_info () != UI_TARGET)
+ if (arm_except_unwind_info (&global_options) != UI_TARGET)
return;
if (!(flag_unwind_tables || crtl->uses_eh_lsda)
/* Implement TARGET_EXCEPT_UNWIND_INFO. */
static enum unwind_info_type
-arm_except_unwind_info (void)
+arm_except_unwind_info (struct gcc_options *opts)
{
/* Honor the --enable-sjlj-exceptions configure switch. */
#ifdef CONFIG_SJLJ_EXCEPTIONS
{
/* 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)
+ if (!opts->x_flag_exceptions && !opts->x_flag_unwind_tables)
return UI_NONE;
else
return UI_TARGET;
void
arm_output_fn_unwind (FILE * f, bool prologue)
{
- if (arm_except_unwind_info () != UI_TARGET)
+ if (arm_except_unwind_info (&global_options) != UI_TARGET)
return;
if (prologue)
field in the TCB, so they can not be used together. */
static bool
-ix86_supports_split_stack (bool report ATTRIBUTE_UNUSED)
+ix86_supports_split_stack (bool report ATTRIBUTE_UNUSED,
+ struct gcc_options *opts ATTRIBUTE_UNUSED)
{
bool ret = true;
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 enum unwind_info_type ia64_except_unwind_info (struct gcc_options *);
static struct bundle_state *get_free_bundle_state (void);
static void free_bundle_state (struct bundle_state *);
current_frame_info.n_output_regs,
current_frame_info.n_rotate_regs);
- if (ia64_except_unwind_info () != UI_TARGET)
+ if (ia64_except_unwind_info (&global_options) != UI_TARGET)
return;
/* Emit the .prologue directive. */
static void
ia64_output_function_end_prologue (FILE *file)
{
- if (ia64_except_unwind_info () != UI_TARGET)
+ if (ia64_except_unwind_info (&global_options) != UI_TARGET)
return;
fputs ("\t.body\n", file);
ia64_emit_insn_before (b, insn);
#if NR_BUNDLES == 10
if ((template0 == 4 || template0 == 5)
- && ia64_except_unwind_info () == UI_TARGET)
+ && ia64_except_unwind_info (&global_options) == UI_TARGET)
{
int i;
rtx note = NULL_RTX;
/* 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 (ia64_except_unwind_info () == UI_TARGET)
+ if (ia64_except_unwind_info (&global_options) == UI_TARGET)
{
rtx insn;
int saw_stop = 0;
static void
ia64_asm_unwind_emit (FILE *asm_out_file, rtx insn)
{
- bool unwind = ia64_except_unwind_info () == UI_TARGET;
+ bool unwind = ia64_except_unwind_info (&global_options) == UI_TARGET;
bool frame = dwarf2out_do_frame ();
rtx note, pat;
bool handled_one;
/* Implement TARGET_EXCEPT_UNWIND_INFO. */
static enum unwind_info_type
-ia64_except_unwind_info (void)
+ia64_except_unwind_info (struct gcc_options *opts)
{
/* Honor the --enable-sjlj-exceptions configure switch. */
#ifdef CONFIG_UNWIND_EXCEPTIONS
/* 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)
+ if (!opts->x_flag_exceptions && !opts->x_flag_unwind_tables)
return UI_NONE;
return UI_TARGET;
call frame information. There is no benefit in using this optimization
on PA8000 and later processors. */
if (pa_cpu >= PROCESSOR_8000
- || (targetm.except_unwind_info () == UI_DWARF2 && flag_exceptions)
+ || (targetm.except_unwind_info (&global_options) == UI_DWARF2
+ && flag_exceptions)
|| flag_unwind_tables)
target_flags &= ~MASK_JUMP_IN_DELAY;
extern void picochip_asm_output_anchor (rtx symbol);
-extern enum unwind_info_type picochip_except_unwind_info (void);
-
/* Instruction set capability flags. These are initialised to the
appropriate values by picochip_option_override, once the user has
selected a CPU type. */
#ifdef STACK_CHECK_PROTECT
#define STACK_OLD_CHECK_PROTECT STACK_CHECK_PROTECT
#else
-#define STACK_OLD_CHECK_PROTECT \
- (targetm.except_unwind_info () == UI_SJLJ ? 75 * UNITS_PER_WORD : 8 * 1024)
+#define STACK_OLD_CHECK_PROTECT \
+ (targetm.except_unwind_info (&global_options) == UI_SJLJ \
+ ? 75 * UNITS_PER_WORD \
+ : 8 * 1024)
#endif
/* Minimum amount of stack required to recover from an anticipated stack
overflow detection. The default value conveys an estimate of the amount
of stack required to propagate an exception. */
#ifndef STACK_CHECK_PROTECT
-#define STACK_CHECK_PROTECT \
- (targetm.except_unwind_info () == UI_SJLJ ? 75 * UNITS_PER_WORD : 12 * 1024)
+#define STACK_CHECK_PROTECT \
+ (targetm.except_unwind_info (&global_options) == UI_SJLJ \
+ ? 75 * UNITS_PER_WORD \
+ : 12 * 1024)
#endif
/* Make the maximum frame size be the largest we can and still only need
macro or @code{IRA_COVER_CLASSES} in order to use the integrated register
allocator with Chaitin-Briggs coloring. If the macro is not defined,
the only available coloring algorithm is Chow's priority coloring.
+
+This hook must not be modified from @code{NULL} to non-@code{NULL} or
+vice versa by command-line option processing.
@end deftypefn
@defmac IRA_COVER_CLASSES
normally defined in @file{libgcc2.c}.
@end deftypefn
-@deftypefn {Target Hook} bool TARGET_SUPPORTS_SPLIT_STACK (bool)
-Whether this target supports splitting the stack. This is called after options have been parsed, so the target may reject splitting the stack in some configurations. The default version of this hook returns false. If @var{report} is true, this function may issue a warning or error; if @var{report} is false, it must simply return a value
+@deftypefn {Target Hook} bool TARGET_SUPPORTS_SPLIT_STACK (bool @var{report}, struct gcc_options *@var{opts})
+Whether this target supports splitting the stack when the options described in @var{opts} have been passed. This is called after options have been parsed, so the target may reject splitting the stack in some configurations. The default version of this hook returns false. If @var{report} is true, this function may issue a warning or error; if @var{report} is false, it must simply return a value
@end deftypefn
@node Varargs
@deftypevr {Target Hook} bool TARGET_HAVE_NAMED_SECTIONS
This flag is true if the target supports @code{TARGET_ASM_NAMED_SECTION}.
+It must not be modified by command-line option processing.
@end deftypevr
@anchor{TARGET_HAVE_SWITCHABLE_BSS_SECTIONS}
or @code{OBJECT_FORMAT_ELF}), GCC will provide a default definition of 1.
@end defmac
-@deftypefn {Target Hook} {enum unwind_info_type} TARGET_EXCEPT_UNWIND_INFO (void)
+@deftypefn {Target Hook} {enum unwind_info_type} TARGET_EXCEPT_UNWIND_INFO (struct gcc_options *@var{opts})
This hook defines the mechanism that will be used for exception handling
by the target. If the target has ABI specified unwind tables, the hook
should return @code{UI_TARGET}. If the target is to use the
default implementation of this hook never returns @code{UI_NONE}.
Note that the value returned by this hook should be constant. It should
-not depend on anything except command-line switches. In particular, the
+not depend on anything except the command-line switches described by
+@var{opts}. In particular, the
setting @code{UI_SJLJ} must be fixed at compiler start-up as C pre-processor
macros and builtin functions related to exception handling are set up
depending on this setting.
The default implementation of the hook first honors the
@option{--enable-sjlj-exceptions} configure option, then
-@code{DWARF2_UNWIND_INFO}, and finally defaults to @code{UI_SJLJ}.
+@code{DWARF2_UNWIND_INFO}, and finally defaults to @code{UI_SJLJ}. If
+@code{DWARF2_UNWIND_INFO} depends on command-line options, the target
+must define this hook so that @var{opts} is used correctly.
@end deftypefn
@deftypevr {Target Hook} bool TARGET_UNWIND_TABLES_DEFAULT
This variable should be set to @code{true} if the target ABI requires unwinding
-tables even when exceptions are not used.
+tables even when exceptions are not used. It must not be modified by
+command-line option processing.
@end deftypevr
@defmac DONT_USE_BUILTIN_SETJMP
macro or @code{IRA_COVER_CLASSES} in order to use the integrated register
allocator with Chaitin-Briggs coloring. If the macro is not defined,
the only available coloring algorithm is Chow's priority coloring.
+
+This hook must not be modified from @code{NULL} to non-@code{NULL} or
+vice versa by command-line option processing.
@end deftypefn
@defmac IRA_COVER_CLASSES
@hook TARGET_HAVE_NAMED_SECTIONS
This flag is true if the target supports @code{TARGET_ASM_NAMED_SECTION}.
+It must not be modified by command-line option processing.
@end deftypevr
@anchor{TARGET_HAVE_SWITCHABLE_BSS_SECTIONS}
default implementation of this hook never returns @code{UI_NONE}.
Note that the value returned by this hook should be constant. It should
-not depend on anything except command-line switches. In particular, the
+not depend on anything except the command-line switches described by
+@var{opts}. In particular, the
setting @code{UI_SJLJ} must be fixed at compiler start-up as C pre-processor
macros and builtin functions related to exception handling are set up
depending on this setting.
The default implementation of the hook first honors the
@option{--enable-sjlj-exceptions} configure option, then
-@code{DWARF2_UNWIND_INFO}, and finally defaults to @code{UI_SJLJ}.
+@code{DWARF2_UNWIND_INFO}, and finally defaults to @code{UI_SJLJ}. If
+@code{DWARF2_UNWIND_INFO} depends on command-line options, the target
+must define this hook so that @var{opts} is used correctly.
@end deftypefn
@hook TARGET_UNWIND_TABLES_DEFAULT
This variable should be set to @code{true} if the target ABI requires unwinding
-tables even when exceptions are not used.
+tables even when exceptions are not used. It must not be modified by
+command-line option processing.
@end deftypevr
@defmac DONT_USE_BUILTIN_SETJMP
return true;
if ((flag_unwind_tables || flag_exceptions)
- && targetm.except_unwind_info () == UI_DWARF2)
+ && targetm.except_unwind_info (&global_options) == UI_DWARF2)
return true;
return false;
dwarf2 unwind info for exceptions, then emit .debug_frame by hand. */
if (!HAVE_GAS_CFI_SECTIONS_DIRECTIVE
&& !flag_unwind_tables && !flag_exceptions
- && targetm.except_unwind_info () != UI_DWARF2)
+ && targetm.except_unwind_info (&global_options) != UI_DWARF2)
return false;
saved_do_cfi_asm = true;
call-site information. We must emit this label if it might be used. */
if (!do_frame
&& (!flag_exceptions
- || targetm.except_unwind_info () != UI_TARGET))
+ || targetm.except_unwind_info (&global_options) != UI_TARGET))
return;
fnsec = function_section (current_function_decl);
dwarf2out_def_cfa (NULL, STACK_POINTER_REGNUM, INCOMING_FRAME_SP_OFFSET);
if (targetm.debug_unwind_info () == UI_DWARF2
- || targetm.except_unwind_info () == UI_DWARF2)
+ || targetm.except_unwind_info (&global_options) == UI_DWARF2)
initial_return_save (INCOMING_RETURN_ADDR_RTX);
}
/* Output another copy for the unwinder. */
if ((flag_unwind_tables || flag_exceptions)
- && targetm.except_unwind_info () == UI_DWARF2)
+ && targetm.except_unwind_info (&global_options) == UI_DWARF2)
output_call_frame_info (1);
}
if (HAVE_GAS_CFI_SECTIONS_DIRECTIVE
&& dwarf2out_do_cfi_asm ()
&& (!(flag_unwind_tables || flag_exceptions)
- || targetm.except_unwind_info () != UI_DWARF2))
+ || targetm.except_unwind_info (&global_options) != UI_DWARF2))
fprintf (asm_out_file, "\t.cfi_sections\t.debug_frame\n");
}
/* Create the SjLj_Function_Context structure. This should match
the definition in unwind-sjlj.c. */
- if (targetm.except_unwind_info () == UI_SJLJ)
+ if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
{
tree f_jbuf, f_per, f_lsda, f_prev, f_cs, f_data, tmp;
basic_block bb;
/* Construct the landing pads. */
- if (targetm.except_unwind_info () == UI_SJLJ)
+ if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
sjlj_build_landing_pads ();
else
dw2_build_landing_pads ();
break_superblocks ();
- if (targetm.except_unwind_info () == UI_SJLJ
+ if (targetm.except_unwind_info (&global_options) == UI_SJLJ
/* Kludge for Alpha/Tru64 (see alpha_gp_save_rtx). */
|| single_succ_edge (ENTRY_BLOCK_PTR)->insns.r)
commit_edge_insertions ();
/* Nothing to do for SJLJ exceptions or if no regions created. */
if (cfun->eh->region_tree == NULL)
return false;
- if (targetm.except_unwind_info () == UI_SJLJ)
+ if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
return false;
return true;
}
eh_data_format_name (tt_format));
#ifndef HAVE_AS_LEB128
- if (targetm.except_unwind_info () == UI_SJLJ)
+ if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
call_site_len = sjlj_size_of_call_site_table ();
else
call_site_len = dw2_size_of_call_site_table (section);
dw2_asm_output_delta_uleb128 (cs_end_label, cs_after_size_label,
"Call-site table length");
ASM_OUTPUT_LABEL (asm_out_file, cs_after_size_label);
- if (targetm.except_unwind_info () == UI_SJLJ)
+ if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
sjlj_output_call_site_table ();
else
dw2_output_call_site_table (cs_format, section);
ASM_OUTPUT_LABEL (asm_out_file, cs_end_label);
#else
dw2_asm_output_data_uleb128 (call_site_len, "Call-site table length");
- if (targetm.except_unwind_info () == UI_SJLJ)
+ if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
sjlj_output_call_site_table ();
else
dw2_output_call_site_table (cs_format, section);
tree decl, type;
char *name;
- switch (targetm.except_unwind_info ())
+ switch (targetm.except_unwind_info (&global_options))
{
case UI_NONE:
return NULL;
/* Output the label for the actual return from the function. */
emit_label (return_label);
- if (targetm.except_unwind_info () == UI_SJLJ)
+ if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
{
/* Let except.c know where it should emit the call to unregister
the function context for sjlj exceptions. */
may trap are not moved into the epilogue by scheduling, because
we don't always emit unwind information for the epilogue. */
if (cfun->can_throw_non_call_exceptions
- && targetm.except_unwind_info () != UI_SJLJ)
+ && targetm.except_unwind_info (&global_options) != UI_SJLJ)
emit_insn (gen_blockage ());
/* If stack protection is enabled for this function, check the guard. */
return false;
}
+/* Generic hook that takes (bool, struct gcc_options *) and returns false. */
+bool
+hook_bool_bool_gcc_optionsp_false (bool a ATTRIBUTE_UNUSED,
+ struct gcc_options *opts ATTRIBUTE_UNUSED)
+{
+ return false;
+}
+
/* Generic hook that takes const int, const int) and returns true. */
bool hook_bool_const_int_const_int_true (const int a ATTRIBUTE_UNUSED,
const int b ATTRIBUTE_UNUSED)
extern bool hook_bool_void_false (void);
extern bool hook_bool_void_true (void);
extern bool hook_bool_bool_false (bool);
+extern bool hook_bool_bool_gcc_optionsp_false (bool, struct gcc_options *);
extern bool hook_bool_const_int_const_int_true (const int, const int);
extern bool hook_bool_mode_false (enum machine_mode);
extern bool hook_bool_mode_true (enum machine_mode);
{
enum unwind_info_type ui_except;
- /* These assertions are because of the use of target hooks that
- still access global data rather than being passed an options
- structure pointer. */
- gcc_assert (opts == &global_options);
- gcc_assert (opts_set = &global_options_set);
-
if (opts->x_dump_base_name && ! IS_ABSOLUTE_PATH (opts->x_dump_base_name))
{
/* First try to make OPTS->X_DUMP_BASE_NAME relative to the
generating unwind info. If opts->x_flag_exceptions is turned on
we need to turn off the partitioning optimization. */
- ui_except = targetm.except_unwind_info ();
+ ui_except = targetm.except_unwind_info (opts);
if (opts->x_flag_exceptions
&& opts->x_flag_reorder_blocks_and_partition
opts->x_flag_split_stack = 0;
else if (opts->x_flag_split_stack)
{
- if (!targetm.supports_split_stack (true))
+ if (!targetm.supports_split_stack (true, opts))
{
error_at (loc, "%<-fsplit-stack%> is not supported by "
"this compiler configuration");
int value = decoded->value;
enum opt_code code = (enum opt_code) scode;
- gcc_assert (opts == &global_options);
- gcc_assert (opts_set == &global_options_set);
- gcc_assert (dc == global_dc);
gcc_assert (decoded->canonical_option_num_elements <= 2);
switch (code)
DEFHOOK
(supports_split_stack,
- "Whether this target supports splitting the stack. This is called\
+ "Whether this target supports splitting the stack when the options\
+ described in @var{opts} have been passed. This is called\
after options have been parsed, so the target may reject splitting\
the stack in some configurations. The default version of this hook\
returns false. If @var{report} is true, this function may issue a warning\
or error; if @var{report} is false, it must simply return a value",
- bool, (bool),
- hook_bool_bool_false)
+ bool, (bool report, struct gcc_options *opts),
+ hook_bool_bool_gcc_optionsp_false)
/* Returns NULL if target supports the insn within a doloop block,
otherwise it returns an error message. */
DEFHOOK
(except_unwind_info,
"",
- enum unwind_info_type, (void),
+ enum unwind_info_type, (struct gcc_options *opts),
default_except_unwind_info)
/* Leave the boolean fields at the end. */
/* Determine the exception handling mechanism for the target. */
enum unwind_info_type
-default_except_unwind_info (void)
+default_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED)
{
/* Obey the configure switch to turn on sjlj exceptions. */
#ifdef CONFIG_SJLJ_EXCEPTIONS
/* To be used by targets that force dwarf2 unwind enabled. */
enum unwind_info_type
-dwarf2_except_unwind_info (void)
+dwarf2_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED)
{
/* Obey the configure switch to turn on sjlj exceptions. */
#ifdef CONFIG_SJLJ_EXCEPTIONS
/* To be used by targets that force sjlj unwind enabled. */
enum unwind_info_type
-sjlj_except_unwind_info (void)
+sjlj_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED)
{
return UI_SJLJ;
}
extern bool default_class_likely_spilled_p (reg_class_t);
extern enum unwind_info_type default_debug_unwind_info (void);
-extern enum unwind_info_type default_except_unwind_info (void);
-extern enum unwind_info_type dwarf2_except_unwind_info (void);
-extern enum unwind_info_type sjlj_except_unwind_info (void);
+extern enum unwind_info_type default_except_unwind_info (struct gcc_options *);
+extern enum unwind_info_type dwarf2_except_unwind_info (struct gcc_options *);
+extern enum unwind_info_type sjlj_except_unwind_info (struct gcc_options *);
extern int default_label_align_after_barrier_max_skip (rtx);
extern int default_loop_align_max_skip (rtx);
/* If we are using sjlj exceptions, we may need to add a call to
_Unwind_SjLj_Unregister at exit of the function. Which means
that we cannot do any sibcall transformations. */
- if (targetm.except_unwind_info () == UI_SJLJ
+ if (targetm.except_unwind_info (&global_options) == UI_SJLJ
&& current_function_has_exception_handlers ())
return false;
ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
local_define_builtin ("__builtin_unwind_resume", ftype,
BUILT_IN_UNWIND_RESUME,
- (targetm.except_unwind_info () == UI_SJLJ
+ ((targetm.except_unwind_info (&global_options)
+ == UI_SJLJ)
? "_Unwind_SjLj_Resume" : "_Unwind_Resume"),
ECF_NORETURN);