aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2004-08-16 20:08:31 +0000
committerFariborz Jahanian <fjahanian@gcc.gnu.org>2004-08-16 20:08:31 +0000
commit93f90be62c1d84539017ab6d73b061993b367f54 (patch)
tree7ef0be49eaaa279546b71216e1d64b9fd033a840
parent392765bf8d611c30e50e135893fb61bfad198d42 (diff)
downloadgcc-93f90be62c1d84539017ab6d73b061993b367f54.zip
gcc-93f90be62c1d84539017ab6d73b061993b367f54.tar.gz
gcc-93f90be62c1d84539017ab6d73b061993b367f54.tar.bz2
Patch to fix -mcpu=G5 interface to EH runtime library.
Reviewed by Geoff Keating. From-SVN: r86074
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/rs6000/rs6000.c12
-rw-r--r--gcc/except.c11
-rw-r--r--gcc/target-def.h4
-rw-r--r--gcc/target.h3
-rw-r--r--gcc/targhooks.c6
-rw-r--r--gcc/targhooks.h2
7 files changed, 44 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c6d74bd..85d5500 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2004-08-16 Fariborz Jahanian <fjahanian@apple.com>
+
+ * except.c (get_exception_filter, build_post_landing_pads,
+ dw2_build_landing_pads): Use target-specific mode for 'filter'.
+ * target-def.h (TARGET_EH_RETURN_FILTER_MODE): macro defined and used.
+ * target.h (eh_return_filter_mode): New field added.
+ * targhooks.c (default_eh_return_filter_mode): Defined.
+ * targhooks.h (default_eh_return_filter_mode): Declared.
+ * config/rs6000/rs6000.c (rs6000_eh_return_filter_mode): Defined.
+
2004-08-16 Nathanael Nerode <neroden@gcc.gnu.org>
* configure.ac: Replace _GCC_TOPLEV_NONCANONICAL_TARGET with
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index fc63c31..a1760ed 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -748,6 +748,8 @@ static tree rs6000_build_builtin_va_list (void);
static tree rs6000_gimplify_va_arg (tree, tree, tree *, tree *);
static bool rs6000_must_pass_in_stack (enum machine_mode, tree);
+static enum machine_mode rs6000_eh_return_filter_mode (void);
+
/* Hash table stuff for keeping track of TOC entries. */
struct toc_hash_struct GTY(())
@@ -964,6 +966,9 @@ static const char alt_reg_names[][8] =
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
#define TARGET_GIMPLIFY_VA_ARG_EXPR rs6000_gimplify_va_arg
+#undef TARGET_EH_RETURN_FILTER_MODE
+#define TARGET_EH_RETURN_FILTER_MODE rs6000_eh_return_filter_mode
+
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -17171,4 +17176,11 @@ rs6000_dbx_register_number (unsigned int regno)
abort ();
}
+/* target hook eh_return_filter_mode */
+static enum machine_mode
+rs6000_eh_return_filter_mode (void)
+{
+ return TARGET_32BIT ? SImode : word_mode;
+}
+
#include "gt-rs6000.h"
diff --git a/gcc/except.c b/gcc/except.c
index d45f1b2..c9e086e 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -628,7 +628,7 @@ get_exception_filter (struct function *fun)
rtx filter = fun->eh->filter;
if (fun == cfun && ! filter)
{
- filter = gen_reg_rtx (word_mode);
+ filter = gen_reg_rtx (targetm.eh_return_filter_mode ());
fun->eh->filter = filter;
}
return filter;
@@ -1528,7 +1528,8 @@ build_post_landing_pads (void)
emit_cmp_and_jump_insns
(cfun->eh->filter,
GEN_INT (tree_low_cst (TREE_VALUE (flt_node), 0)),
- EQ, NULL_RTX, word_mode, 0, c->label);
+ EQ, NULL_RTX,
+ targetm.eh_return_filter_mode (), 0, c->label);
tp_node = TREE_CHAIN (tp_node);
flt_node = TREE_CHAIN (flt_node);
@@ -1560,7 +1561,8 @@ build_post_landing_pads (void)
emit_cmp_and_jump_insns (cfun->eh->filter,
GEN_INT (region->u.allowed.filter),
- EQ, NULL_RTX, word_mode, 0, region->label);
+ EQ, NULL_RTX,
+ targetm.eh_return_filter_mode (), 0, region->label);
/* We delay the generation of the _Unwind_Resume until we generate
landing pads. We emit a marker here so as to get good control
@@ -1738,7 +1740,8 @@ dw2_build_landing_pads (void)
emit_move_insn (cfun->eh->exc_ptr,
gen_rtx_REG (ptr_mode, EH_RETURN_DATA_REGNO (0)));
emit_move_insn (cfun->eh->filter,
- gen_rtx_REG (word_mode, EH_RETURN_DATA_REGNO (1)));
+ gen_rtx_REG (targetm.eh_return_filter_mode (),
+ EH_RETURN_DATA_REGNO (1)));
seq = get_insns ();
end_sequence ();
diff --git a/gcc/target-def.h b/gcc/target-def.h
index 407ee0b..7180a3e 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -268,6 +268,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_SCHED_DFA_NEW_CYCLE, \
TARGET_SCHED_IS_COSTLY_DEPENDENCE}
+/* In except.c */
+#define TARGET_EH_RETURN_FILTER_MODE default_eh_return_filter_mode;
+
/* In tree.c. */
#define TARGET_MERGE_DECL_ATTRIBUTES merge_decl_attributes
#define TARGET_MERGE_TYPE_ATTRIBUTES merge_type_attributes
@@ -436,6 +439,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
{ \
TARGET_ASM_OUT, \
TARGET_SCHED, \
+ TARGET_EH_RETURN_FILTER_MODE, \
TARGET_MERGE_DECL_ATTRIBUTES, \
TARGET_MERGE_TYPE_ATTRIBUTES, \
TARGET_ATTRIBUTE_TABLE, \
diff --git a/gcc/target.h b/gcc/target.h
index 9a185e5..ad37161 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -276,6 +276,9 @@ struct gcc_target
bool (* is_costly_dependence) (rtx, rtx, rtx, int, int);
} sched;
+ /* Return machine mode for filter value. */
+ enum machine_mode (* eh_return_filter_mode) (void);
+
/* Given two decls, merge their attributes and return the result. */
tree (* merge_decl_attributes) (tree, tree);
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 3eff2fd..00d7e84 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -128,6 +128,12 @@ default_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED)
!= default_setup_incoming_varargs);
}
+enum machine_mode
+default_eh_return_filter_mode (void)
+{
+ return word_mode;
+}
+
/* Generic hook that takes a CUMULATIVE_ARGS pointer and returns true. */
bool
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index 5fa6a55..077175e 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -31,6 +31,8 @@ extern rtx default_builtin_setjmp_frame_value (void);
extern bool hook_bool_CUMULATIVE_ARGS_false (CUMULATIVE_ARGS *);
extern bool default_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *);
+extern enum machine_mode default_eh_return_filter_mode (void);
+
extern bool hook_bool_CUMULATIVE_ARGS_true (CUMULATIVE_ARGS *);
extern tree default_cxx_guard_type (void);
extern tree default_cxx_get_cookie_size (tree);