diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2008-06-18 20:49:12 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2008-06-18 20:49:12 +0000 |
commit | 7b0518e33c7818cbaa640257226e13513e86671e (patch) | |
tree | cdc7fc54ba1d87f25a40abeb7252e518dc5a4f8a /gcc/except.c | |
parent | aa5d99391813f31c6ded568a345701fc935f2d83 (diff) | |
download | gcc-7b0518e33c7818cbaa640257226e13513e86671e.zip gcc-7b0518e33c7818cbaa640257226e13513e86671e.tar.gz gcc-7b0518e33c7818cbaa640257226e13513e86671e.tar.bz2 |
targhooks.h (struct gcc_target): New member unwind_word_mode.
* targhooks.h (struct gcc_target): New member unwind_word_mode.
(default_unwind_word_mode): Add prototype.
* targhooks.c (default_unwind_word_mode): New function.
(default_eh_return_filter_mode): Return targetm.unwind_word_mode ()
instead of word_mode.
* target-def.h (TARGET_UNWIND_WORD_MODE): New macro.
(TARGET_INITIALIZER): Use it.
* c-common.c (handle_mode_attribute): Support "unwind_word"
mode attribute.
* unwind-generic.h (_Unwind_Word, _Unwind_Sword): Use it.
* except.c (init_eh): Use targetm.unwind_word_mode () instead of
word_mode to access SjLj_Function_Context member "data".
(sjlj_emit_dispatch_table): Likewise. Also, perform type
conversion from targetm.eh_return_filter_mode () to
targetm.unwind_word_mode () if they differ.
* builtin-types.def (BT_UNWINDWORD): New primitive type.
(BT_FN_UNWINDWORD_PTR): New function type.
(BT_FN_WORD_PTR): Remove.
* builtins.def (BUILT_IN_EXTEND_POINTER): Use BT_FN_UNWINDWORD_PTR.
* except.c (expand_builtin_extend_pointer): Convert pointer to
targetm.unwind_word_mode () instead of word_mode.
* config/spu/spu-protos.h (spu_eh_return_filter_mode): Remove.
* config/spu/spu.c (spu_eh_return_filter_mode): Remove.
(spu_unwind_word_mode): New function.
(TARGET_EH_RETURN_FILTER_MODE): Do not define.
(TARGET_UNWIND_WORD_MODE): Define.
* config/spu/t-spu-elf (TARGET_LIBGCC2_CFLAGS): Remove -D__word__=SI.
From-SVN: r136912
Diffstat (limited to 'gcc/except.c')
-rw-r--r-- | gcc/except.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/except.c b/gcc/except.c index 8ebfd7f..e6a1650 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -338,7 +338,8 @@ init_eh (void) DECL_FIELD_CONTEXT (f_cs) = sjlj_fc_type_node; tmp = build_index_type (build_int_cst (NULL_TREE, 4 - 1)); - tmp = build_array_type (lang_hooks.types.type_for_mode (word_mode, 1), + tmp = build_array_type (lang_hooks.types.type_for_mode + (targetm.unwind_word_mode (), 1), tmp); f_data = build_decl (FIELD_DECL, get_identifier ("__data"), tmp); DECL_FIELD_CONTEXT (f_data) = sjlj_fc_type_node; @@ -1932,6 +1933,8 @@ sjlj_emit_function_exit (void) static void sjlj_emit_dispatch_table (rtx dispatch_label, struct sjlj_lp_info *lp_info) { + enum machine_mode unwind_word_mode = targetm.unwind_word_mode (); + enum machine_mode filter_mode = targetm.eh_return_filter_mode (); int i, first_reachable; rtx mem, dispatch, seq, fc; rtx before; @@ -1954,8 +1957,8 @@ sjlj_emit_dispatch_table (rtx dispatch_label, struct sjlj_lp_info *lp_info) sjlj_fc_call_site_ofs); dispatch = copy_to_reg (mem); - mem = adjust_address (fc, word_mode, sjlj_fc_data_ofs); - if (word_mode != ptr_mode) + mem = adjust_address (fc, unwind_word_mode, sjlj_fc_data_ofs); + if (unwind_word_mode != ptr_mode) { #ifdef POINTERS_EXTEND_UNSIGNED mem = convert_memory_address (ptr_mode, mem); @@ -1965,7 +1968,10 @@ sjlj_emit_dispatch_table (rtx dispatch_label, struct sjlj_lp_info *lp_info) } emit_move_insn (crtl->eh.exc_ptr, mem); - mem = adjust_address (fc, word_mode, sjlj_fc_data_ofs + UNITS_PER_WORD); + mem = adjust_address (fc, unwind_word_mode, + sjlj_fc_data_ofs + GET_MODE_SIZE (unwind_word_mode)); + if (unwind_word_mode != filter_mode) + mem = convert_to_mode (filter_mode, mem, 0); emit_move_insn (crtl->eh.filter, mem); /* Jump to one of the directly reachable regions. */ @@ -3002,7 +3008,7 @@ expand_builtin_extend_pointer (tree addr_tree) extend = 1; #endif - return convert_modes (word_mode, ptr_mode, addr, extend); + return convert_modes (targetm.unwind_word_mode (), ptr_mode, addr, extend); } /* In the following functions, we represent entries in the action table |