aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/ia64
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2007-10-16 09:13:47 +0000
committerMaxim Kuvyrkov <mkuvyrkov@gcc.gnu.org>2007-10-16 09:13:47 +0000
commit215b063c9d8700616d5c189cd12eef4e748de5fe (patch)
treef33444e9bf6a5e0115d66e6ac3261973224f32ca /gcc/config/ia64
parent50f2fe3ad42ccf45a62d3bc899f55d5c068891ac (diff)
downloadgcc-215b063c9d8700616d5c189cd12eef4e748de5fe.zip
gcc-215b063c9d8700616d5c189cd12eef4e748de5fe.tar.gz
gcc-215b063c9d8700616d5c189cd12eef4e748de5fe.tar.bz2
target.h (unspec_may_trap_p): New target hook.
2007-10-16 Paolo Bonzini <bonzini@gnu.org> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (unspec_may_trap_p): New target hook. * target-def.h (TARGET_UNSPEC_MAY_TRAP_P): New macro. * targhooks.c (default_unspec_may_trap_p): Default implementation of the hook. * targhooks.h (default_unspec_may_trap_p): Declare it. * doc/tm.texi (TARGET_UNSPEC_MAY_TRAP_P): Document new hook. * rtlanal.c (may_trap_p_1): Use new hook. Make global. * rtl.h (may_trap_p_1): Declare. * config/ia64/ia64.c (ia64_unspec_may_trap_p): New function to override default hook implementation. (TARGET_UNSPEC_MAY_TRAP_P): Override default implementation of the hook. * gcc.target/ia64/20040709-2.c: New test. Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r129378
Diffstat (limited to 'gcc/config/ia64')
-rw-r--r--gcc/config/ia64/ia64.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index d4ad0f4..537f9f0 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -203,6 +203,7 @@ static int ia64_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
static bool ia64_function_ok_for_sibcall (tree, tree);
static bool ia64_return_in_memory (const_tree, const_tree);
static bool ia64_rtx_costs (rtx, int, int, int *);
+static int ia64_unspec_may_trap_p (const_rtx, unsigned);
static void fix_range (const char *);
static bool ia64_handle_option (size_t, const char *, int);
static struct machine_function * ia64_init_machine_status (void);
@@ -409,6 +410,9 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST hook_int_rtx_0
+#undef TARGET_UNSPEC_MAY_TRAP_P
+#define TARGET_UNSPEC_MAY_TRAP_P ia64_unspec_may_trap_p
+
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG ia64_reorg
@@ -5073,6 +5077,29 @@ ia64_secondary_reload_class (enum reg_class class,
}
+/* Implement targetm.unspec_may_trap_p hook. */
+static int
+ia64_unspec_may_trap_p (const_rtx x, unsigned flags)
+{
+ if (GET_CODE (x) == UNSPEC)
+ {
+ switch (XINT (x, 1))
+ {
+ case UNSPEC_LDA:
+ case UNSPEC_LDS:
+ case UNSPEC_LDSA:
+ case UNSPEC_LDCCLR:
+ case UNSPEC_CHKACLR:
+ case UNSPEC_CHKS:
+ /* These unspecs are just wrappers. */
+ return may_trap_p_1 (XVECEXP (x, 0, 0), flags);
+ }
+ }
+
+ return default_unspec_may_trap_p (x, flags);
+}
+
+
/* Parse the -mfixed-range= option string. */
static void