Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> @@ -14897,6 +14892,32 @@ distance_agu_use (unsigned int regno0, r
>    return distance >> 1;
>  }
>  
> +/* Copy recog_data_d from SRC to DEST.  */
> +
> +static void
> +copy_recog_data (recog_data_d *dest, recog_data_d *src)
> +{
> +  dest->n_operands = src->n_operands;
> +  dest->n_dups = src->n_dups;
> +  dest->n_alternatives = src->n_alternatives;
> +  dest->is_asm = src->is_asm;
> +  dest->insn = src->insn;
> +  for (int i = 0; i < src->n_operands; i++)
> +    {
> +      dest->operand[i] = src->operand[i];
> +      dest->operand_loc[i] = src->operand_loc[i];
> +      dest->constraints[i] = src->constraints[i];
> +      dest->is_operator[i] = src->is_operator[i];
> +      dest->operand_mode[i] = src->operand_mode[i];
> +      dest->operand_type[i] = src->operand_type[i];
> +    }
> +  for (int i = 0; i < src->n_dups; i++)
> +    {
> +      dest->dup_loc[i] = src->dup_loc[i];
> +      dest->dup_num[i] = src->dup_num[i];
> +    }
> +}
> +
>  /* Define this macro to tune LEA priority vs ADD, it take effect when
>     there is a dilemma of choosing LEA or ADD
>     Negative value: ADD is more preferred than LEA

Can I put in a plea to put this in recog.[hc], and possibly also make
it a copy constructor for recog_data_d?  I can't think of any legitimate
cases in which we'd want to copy the whole structure, instead of just
the active parts.

Thanks,
Richard

Reply via email to