https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118992

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #6)
> This works for x86-64:
> 
> diff --git a/gcc/cse.cc b/gcc/cse.cc
> index 70d5caac4ca..786624cd890 100644
> --- a/gcc/cse.cc
> +++ b/gcc/cse.cc
> @@ -2287,6 +2287,10 @@ hash_rtx (const_rtx x, machine_mode mode,
>          record = true;
>        else if (GET_MODE_CLASS (GET_MODE (x)) == MODE_CC)
>          record = true;
> +      else if (REG_ATTRS (x)
> +          && REG_EXPR (x)
> +          && TREE_CODE (REG_EXPR (x)) == PARM_DECL)
> +        record = true;

as a heuristic this doesn't make much sense

>        else if (targetm.small_register_classes_for_mode_p (GET_MODE (x)))
>          record = false;
>        else if (targetm.class_likely_spilled_p (REGNO_REG_CLASS (regno)))

so which one is true for x86?  The 2nd?  This is actually a quite bad
heuristic given it applies 'locally' instead when performing a replacement
which can take into account distance and register pressure.

Reply via email to