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

--- Comment #4 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
(In reply to Stefan Schulze Frielinghaus from comment #3)
> Since we already select via a filter the hard register, we could set the
> class to ALL_REGS.  Could you give the following a try:
> 
> diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc
> index 83f8fda3b52..18298e14586 100644
> --- a/gcc/lra-constraints.cc
> +++ b/gcc/lra-constraints.cc
> @@ -2551,7 +2551,7 @@ process_alt_operands (int only_alternative)
>                     {
>                       int regno = decode_hard_reg_constraint (p);
>                       gcc_assert (regno >= 0);
> -                     cl = REGNO_REG_CLASS (regno);
> +                     cl = ALL_REGS;
>                       CLEAR_HARD_REG_SET (hard_reg_constraint);
>                       SET_HARD_REG_BIT (hard_reg_constraint, regno);
>                       cl_filter = &hard_reg_constraint;
> 
> It works for me in a cross compiler.
Thank you for looking into this. It works (I had to apply the patch by hand due
to rejects).

Though I used GENERAL_REGS, since as far as I no, HRC doesn't support fixed
regs.

It works in inline asm and for the bswap insn in avr.md.  Great! :-)

Reply via email to