Re: [PATCH] Explicit register earlyclobber fix

2015-09-22 Thread Jeff Law
On 09/22/2015 01:20 PM, Richard Henderson wrote: On 09/22/2015 12:18 PM, Jeff Law wrote: On 09/22/2015 01:15 PM, Richard Henderson wrote: And doesn't it have to be =& and always at the start for an asm constraint? For operands in patterns, we have to consider operand alternatives, but that's no

Re: [PATCH] Explicit register earlyclobber fix

2015-09-22 Thread Richard Henderson
On 09/22/2015 12:18 PM, Jeff Law wrote: > On 09/22/2015 01:15 PM, Richard Henderson wrote: >>> And doesn't it have to be =& and always at the start for an asm constraint? >>> For operands in patterns, we have to consider operand alternatives, but >>> that's >>> not on issue here. >> >> Technically

Re: [PATCH] Explicit register earlyclobber fix

2015-09-22 Thread Jeff Law
On 09/22/2015 01:15 PM, Richard Henderson wrote: And doesn't it have to be =& and always at the start for an asm constraint? For operands in patterns, we have to consider operand alternatives, but that's not on issue here. Technically we do support alternatives on asms. Not usefully except for

Re: [PATCH] Explicit register earlyclobber fix

2015-09-22 Thread Richard Henderson
On 09/22/2015 12:12 PM, Jeff Law wrote: > On 09/22/2015 12:50 PM, Richard Henderson wrote: >> >>> +asm_constraint_earlyclobber (const char *constraint) >>> +{ >>> + while (*constraint != 0) >>> +{ >>> + if (*constraint == '&') >>> +return true; >>> + ++constraint; >>> +} >>>

Re: [PATCH] Explicit register earlyclobber fix

2015-09-22 Thread Jeff Law
On 09/22/2015 12:50 PM, Richard Henderson wrote: +asm_constraint_earlyclobber (const char *constraint) +{ + while (*constraint != 0) +{ + if (*constraint == '&') + return true; + ++constraint; +} + return false; +} This would be return strchr (constraint, '&') !=

Re: [PATCH] Explicit register earlyclobber fix

2015-09-22 Thread Richard Henderson
> + /* 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 t

[PATCH] Explicit register earlyclobber fix

2015-09-22 Thread Andrew Jenner
When using an asm register variable as an input or output operand for an inline assembler block, GCC guarantees that the specified register is used for the operand in question (see https://gcc.gnu.org/onlinedocs/gcc/Local-Reg-Vars.html). Together with earlyclobber constraints (https://gcc.gnu.