diff options
author | olegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-08 22:50:38 +0000 |
---|---|---|
committer | olegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-08 22:50:38 +0000 |
commit | c8378feb80450a66e46f69938eba4388723a2c67 (patch) | |
tree | 47e2a7d6633bf0a15b112a4d21a9ec9052feb278 | |
parent | 62f13add7bad8e4ba14139b297d8cf0d89b0c77a (diff) | |
download | gcc-c8378feb80450a66e46f69938eba4388723a2c67.tar.gz |
* config/sh/sh.md (*return_i): Move trap_exit attribute check to ...
* config/sh/sh.c (sh_cfun_trap_exit_p): ... this new function.
* config/sh/sh-protos.h: Declare it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189362 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/sh/sh-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 9 | ||||
-rw-r--r-- | gcc/config/sh/sh.md | 3 |
4 files changed, 17 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c0883035d9d..6ff48665ed5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-07-08 Oleg Endo <olegendo@gcc.gnu.org> + + * config/sh/sh.md (*return_i): Move trap_exit attribute check to ... + * config/sh/sh.c (sh_cfun_trap_exit_p): ... this new function. + * config/sh/sh-protos.h: Declare it. + 2012-07-08 Steven Bosscher <steven@gcc.gnu.org> * mcf.c: Do not include tm.h, tree.h, and langhooks.h. diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h index 3fcfe29a28a..63fa599e7a5 100644 --- a/gcc/config/sh/sh-protos.h +++ b/gcc/config/sh/sh-protos.h @@ -106,6 +106,7 @@ extern void sh_expand_binop_v2sf (enum rtx_code, rtx, rtx, rtx); extern bool sh_expand_t_scc (rtx *); extern rtx sh_gen_truncate (enum machine_mode, rtx, int); extern bool sh_vector_mode_supported_p (enum machine_mode); +extern bool sh_cfun_trap_exit_p (void); #endif /* RTX_CODE */ extern const char *output_jump_label_table (void); diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 77324b66c94..a53c3be91e9 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -9309,6 +9309,15 @@ sh_cfun_resbank_handler_p (void) != NULL_TREE) && TARGET_SH2A); } +/* Returns true if the current function has a "trap_exit" attribute set. */ + +bool +sh_cfun_trap_exit_p (void) +{ + return lookup_attribute ("trap_exit", DECL_ATTRIBUTES (current_function_decl)) + != NULL_TREE; +} + /* Implement TARGET_CHECK_PCH_TARGET_FLAGS. */ static const char * diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index cf37cb9179d..bc2b7aeafc6 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -9442,8 +9442,7 @@ label: && (crtl->args.info.call_cookie & CALL_COOKIE_RET_TRAMP (1))) && reload_completed - && lookup_attribute (\"trap_exit\", - DECL_ATTRIBUTES (current_function_decl)) == NULL_TREE" + && ! sh_cfun_trap_exit_p ()" { if (TARGET_SH2A && (dbr_sequence_length () == 0) && !current_function_interrupt) |