This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Explicit register earlyclobber fix
- From: Richard Henderson <rth at redhat dot com>
- To: Andrew Jenner <andrew at codesourcery dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 22 Sep 2015 11:50:05 -0700
- Subject: Re: [PATCH] Explicit register earlyclobber fix
- Authentication-results: sourceware.org; auth=none
- References: <56017AA6 dot 20709 at codesourcery dot com>
> + /* Registers that can not be allocated for this allocno, for example because
> + there is an ASM_OPERANDS with that register as an output and this pseudo
> + as an earlyclobber input. */
> + HARD_REG_SET forbidden_regs;
You mean "with that register as an earlyclobber output and this pseudo as an
input". There is no such thing as an earlyclobber input. ;-)
> +asm_constraint_earlyclobber (const char *constraint)
> +{
> + while (*constraint != 0)
> + {
> + if (*constraint == '&')
> + return true;
> + ++constraint;
> + }
> + return false;
> +}
This would be
return strchr (constraint, '&') != NULL;
but we don't actually have to search the whole string, surely. I'd be
surprised if early clobber could be anywhere except at the start of the constraint.
> + if (REG_P (op))
> + {
> + unsigned int regno = REGNO (op);
> + if (regno < FIRST_PSEUDO_REGISTER)
> + for (int j = 0; j < noperands; j++)
> + {
> + rtx op2;
> + if (j == i)
> + continue;
> + op2 = operands[j];
> + if (REG_P (op2) && REGNO (op2) == regno)
> + return 0;
> + }
> + }
reg_overlap_mentioned_p.
r~