On Wed, Oct 27, 2021 at 08:37:57PM -0500, Peter Bergner wrote: > PR102976 shows a test case where we generate wrong code when building > a vector pair from 2 vector registers. The bug here is that with unlucky > register assignments, we can clobber one of the input operands before > we write both registers of the output operand. The solution is to use > early-clobbers in the assemble pair and accumulator patterns.
Because of what insns there are after the split. Aha. Please add a comment explaining this, near the earlyclobber itself. A usually nicer way of doing it is by special casing the split code for this situation. But with the comment in place the way you do it might even be preferable here :-) > +/* { dg-final { scan-assembler-times {xxlor[^,]*,44,44} 1 } } */ > +/* { dg-final { scan-assembler-times {xxlor[^,]*,32,32} 1 } } */ Bracket expressions using ^ match newlines as well, unless you use (partial) newline-sensitive matching. Partial is almost always what you want, so start the regex with (?p) ? You also want to add some \m and \M btw. For example, as written his will match xxlorc insns as well. Not a super big deal, but :-) You can just write this as {\mxxlor \d+,44,44\M} etc., that will be simplest I think. Okay for trunk with comments added near the earlyclobber, and the RE improved. Also fine for 11 after some burn-in. Thanks! Segher