On Sun, Jul 08, 2012 at 02:44:15PM +0200, Steven Bosscher wrote:
> IMHO, no RTL pass implementation file should have to include tree.h.
> So ira-conflicts.c shouldn't need tree.h. The reason it needed it, was
> because there is code to avoid putting user variables in callee
> clobbered registers, and ira-conflict.c looked at DECL_ARTIFICIAL
> (REG_EXPR (reg)). But it can just look at REG_USERVAR_P(reg) instead,
> which is simper and cleaner.

But it regresses PR53948.

> --- ira-conflicts.c   (revision 189359)
> +++ ira-conflicts.c   (working copy)
> @@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
>  #include "tm.h"
>  #include "regs.h"
>  #include "rtl.h"
> -#include "tree.h"            /* For DECL_ARTIFICIAL and friends.  */
>  #include "tm_p.h"
>  #include "target.h"
>  #include "flags.h"
> @@ -893,17 +892,12 @@ ira_build_conflicts (void)
>        for (i = 0; i < n; i++)
>       {
>         ira_object_t obj = ALLOCNO_OBJECT (a, i);
> -       reg_attrs *attrs = REG_ATTRS (regno_reg_rtx [ALLOCNO_REGNO (a)]);
> -       tree decl;
> +       rtx allocno_reg = regno_reg_rtx [ALLOCNO_REGNO (a)];
> 
>         if ((! flag_caller_saves && ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
>             /* For debugging purposes don't put user defined variables in
>                callee-clobbered registers.  */
> -           || (optimize == 0
> -               && attrs != NULL
> -               && (decl = attrs->decl) != NULL
> -               && VAR_OR_FUNCTION_DECL_P (decl)
> -               && ! DECL_ARTIFICIAL (decl)))
> +           || (optimize == 0 && REG_USERVAR_P (allocno_reg)))
>           {
>             IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),
>                               call_used_reg_set);

        Jakub

Reply via email to