This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, rs6000] Fixing PR 67145


On Thu, Feb 25, 2016 at 09:08:32PM -0800, Richard Henderson wrote:
> diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
> index 450fa8b..9d55e7b 100644
> --- a/gcc/simplify-rtx.c
> +++ b/gcc/simplify-rtx.c
> @@ -4421,9 +4421,17 @@ simplify_plus_minus (enum rtx_code code, machine_mode mode, rtx op0,
>        n_ops = i;
>      }
>  
> -  /* If nothing changed, fail.  */
> +  /* If nothing changed, check that rematerialization of rtl instructions
> +     is still required.  */
>    if (!canonicalized)
> -    return NULL_RTX;
> +    {
> +      /* Perform rematerialization if only all operands are registers and
> +         all operations are PLUS.  */
> +      for (i = 0; i < n_ops; i++)
> +	if (ops[i].neg || !REG_P (ops[i].op))
> +	  return NULL_RTX;
> +      goto gen_result;
> +    }

If you check for fixed registers as well here, does that work for you?


Segher


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]