On 2/20/19 8:19 PM, Peter Bergner wrote:
> PR89313 exposes a bug in the asmcons pass where it replaces input operands
> with matching constraints with their associated output operands, as well as
> all other uses of its pseudo registers. This is normally fine. However, if
> the matched output operand is marked as early clobber, then we cannot replace
> the uses of 'input' that do not have matching constraints, since they by
> definition conflict with the early clobber output operand and could be
> clobbered if assigned to the same register as the output operand.
>
> The patch below fixes the bug by only doing the input pseudo replacement
> if the output operand is not early clobber or the input operand is known
> to be a matching constraint.
>
> This passed bootstrap and regression testing with no regressions on
> both x86_64-linux and powerpc64le-linux. Ok for mainline?
>
> Peter
>
>
> gcc/
> PR rtl-optimization/89313
> * function.c (matching_constraint_num): New static function.
> (match_asm_constraints_1): Use it. Fixup white space and comment.
> Don't replace inputs with non-matching constraints which conflict
> with early clobber outputs.
>
> gcc/testsuite/
> PR rtl-optimization/89313
> * gcc.dg/pr89313.c: New test.
OK.
jeff