gcc-patches@gcc.gnu.org
[Top] [All Lists]

RE: [PATCH] Fix reload failures on inline asm from mplayer SVN (PR rtl

Subject: RE: [PATCH] Fix reload failures on inline asm from mplayer SVN PR rtl-optimization/39543
From: Steven Bosscher
Date: Thu, 26 Mar 2009 17:52:16 +0100
[ xf. http://gcc.gnu.org/ml/gcc-patches/2009-03/msg01315.html ]

> +static int
> +check_reg_count_callback (rtx *px, void *data)

Misses comment before the function.


> +{
> +  int *regnop = (int *) data;
> +
> +  if (!REG_P (*px))
> +    return 0;
> +
> +  if (*regnop < 0 || *regnop == (int) REGNO (*px))

Eh, when can you have *regnop < 0?


> +    {
> +      *regnop = REGNO (*px);
> +      return 0;
> +    }
> +
> +  return 1;
> +}
> +
> +/* Try to replace USE with SRC (defined in DEF_INSN) in __asm.  */
> +
> +static bool
> +forward_propagate_asm (df_ref use, rtx def_set, rtx reg)

Where is DEF_INSN?  You mean DEF_SET in the comment, I think.


> +{
> +  rtx use_insn = DF_REF_INSN (use), src, use_pat, asm_operands, new_rtx, 
> *loc;
> +  int regno, speed_p, i;
> +
> +  gcc_assert ((DF_REF_FLAGS (use) & DF_REF_IN_NOTE) == 0);
> +
> +  src = SET_SRC (def_set);
> +  use_pat = PATTERN (use_insn);
> +
> +  /* In __asm don't replace if src might need more registers than
> +     reg, as that could increase register pressure on the __asm.  */
> +  regno = -1;
> +  if (for_each_rtx (&src, check_reg_count_callback, &regno) > 0)
> +    return false;

Can you use DF_INSN_USES of DEF_SET instead here? All for_each_rtx and
note_stores should die in places where the DF cache can use :-)

Ciao!
Steven

<Prev in Thread] Current Thread [Next in Thread>