diff mbox

[SH] Broken build due to tree.h not being included anymore

Message ID 1341762225.2292.9.camel@yam-132-YW-E178-FTW
State New
Headers show

Commit Message

Oleg Endo July 8, 2012, 3:43 p.m. UTC
Hello,

The recent change that removed the inclusion of tree.h in several places
broke the SH target in one place in sh.md, where stuff from tree.h was
used directly.  I've moved those lines in question into a new function
in sh.c.
Tested with make all-gcc.

OK to install?

Cheers,
Oleg

ChangeLog:

	* 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.

Comments

Steven Bosscher July 8, 2012, 6:51 p.m. UTC | #1
On Sun, Jul 8, 2012 at 5:43 PM, Oleg Endo <oleg.endo@t-online.de> wrote:
> Hello,
>
> The recent change that removed the inclusion of tree.h in several places
> broke the SH target in one place in sh.md, where stuff from tree.h was
> used directly.  I've moved those lines in question into a new function
> in sh.c.

I suppose some breakage was to be expected. I tried auditing all .md
files for usages of things defined in tree.h but I overlooked this
one. Sorry!

> Tested with make all-gcc.
>
> OK to install?

I can't approve it, but it looks obvious enough.

Ciao!
Steven
Kaz Kojima July 8, 2012, 10:17 p.m. UTC | #2
Oleg Endo <oleg.endo@t-online.de> wrote:
> The recent change that removed the inclusion of tree.h in several places
> broke the SH target in one place in sh.md, where stuff from tree.h was
> used directly.  I've moved those lines in question into a new function
> in sh.c.
> Tested with make all-gcc.
> 
> OK to install?

OK.

Regards,
	kaz
Oleg Endo July 8, 2012, 10:51 p.m. UTC | #3
On Sun, 2012-07-08 at 20:51 +0200, Steven Bosscher wrote:
> On Sun, Jul 8, 2012 at 5:43 PM, Oleg Endo <oleg.endo@t-online.de> wrote:
> > Hello,
> >
> > The recent change that removed the inclusion of tree.h in several places
> > broke the SH target in one place in sh.md, where stuff from tree.h was
> > used directly.  I've moved those lines in question into a new function
> > in sh.c.
> 
> I suppose some breakage was to be expected. I tried auditing all .md
> files for usages of things defined in tree.h but I overlooked this
> one. Sorry!
> 

No problem.  Committed as rev 189362.

Cheers,
Oleg
diff mbox

Patch

Index: gcc/config/sh/sh-protos.h
===================================================================
--- gcc/config/sh/sh-protos.h	(revision 189359)
+++ gcc/config/sh/sh-protos.h	(working copy)
@@ -106,6 +106,7 @@ 
 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: gcc/config/sh/sh.c
===================================================================
--- gcc/config/sh/sh.c	(revision 189359)
+++ gcc/config/sh/sh.c	(working copy)
@@ -9309,6 +9309,15 @@ 
               != 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: gcc/config/sh/sh.md
===================================================================
--- gcc/config/sh/sh.md	(revision 189360)
+++ gcc/config/sh/sh.md	(working copy)
@@ -9442,8 +9442,7 @@ 
 		    && (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)