sh.md (*return_i): Move trap_exit attribute check to ...
authorOleg Endo <olegendo@gcc.gnu.org>
Sun, 8 Jul 2012 22:50:38 +0000 (22:50 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Sun, 8 Jul 2012 22:50:38 +0000 (22:50 +0000)
* 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.

From-SVN: r189362

gcc/ChangeLog
gcc/config/sh/sh-protos.h
gcc/config/sh/sh.c
gcc/config/sh/sh.md

index c0883035d9d67a5566e3bcedf08573cf197bdaf6..6ff48665ed562cdfb212643ed5e5aa533dadcf54 100644 (file)
@@ -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.
index 3fcfe29a28acae09b7c8cf788699f9a847566896..63fa599e7a5bea725ee270ce2616c89c327888d0 100644 (file)
@@ -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);
index 77324b66c94b3e3e916e4dbb92e38b7ae69ff9aa..a53c3be91e9f6ad5f237fa68972b1b8c61096d38 100644 (file)
@@ -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 *
index cf37cb9179d8df00744eec7a6bbeb49d4286b506..bc2b7aeafc6e32da843b63ae85b97e3073fa07b8 100644 (file)
@@ -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)