Message ID | alpine.DEB.2.20.2311221501050.5892@tpp.orcam.me.uk |
---|---|
State | New |
Headers | show |
Series | AArch64/testsuite: Use non-capturing parentheses with ccmp_1.c | expand |
On 22/11/2023 15:21, Maciej W. Rozycki wrote: > Use non-capturing parentheses for the subexpressions used with > `scan-assembler-times', to avoid a quirk with double-counting. > > gcc/testsuite/ > * gcc.target/aarch64/ccmp_1.c: Use non-capturing parentheses > with `scan-assembler-times'. OK R. > --- > Hi, > > Here's another one. I realised my original regexp used to grep the tree > for `scan-assembler-times' with subexpressions was too strict and with an > updated pattern I found this second test case that does regress once the > `scan-assembler-times' double-counting quirk has been fixed. > > As with the ARM change we don't need capturing parentheses here, usually > used for back references, so let's just avoid the double-counting quirk > altogether and make our matching here work whether the quirk has been > fixed or not. > > Verified for the `aarch64-linux-gnu' target with the quirk fix submitted > as <https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637254.html> > and the aarch64.exp subset of the C language test suite. OK to apply? > > Maciej > --- > gcc/testsuite/gcc.target/aarch64/ccmp_1.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > gcc-aarch64-test-ccmp_1-non-capturing.diff > Index: gcc/gcc/testsuite/gcc.target/aarch64/ccmp_1.c > =================================================================== > --- gcc.orig/gcc/testsuite/gcc.target/aarch64/ccmp_1.c > +++ gcc/gcc/testsuite/gcc.target/aarch64/ccmp_1.c > @@ -86,8 +86,8 @@ f13 (int a, int b) > /* { dg-final { scan-assembler "cmp\t(.)+35" } } */ > > /* { dg-final { scan-assembler-times "\tcmp\tw\[0-9\]+, 0" 4 } } */ > -/* { dg-final { scan-assembler-times "fcmpe\t(.)+0\\.0" 2 } } */ > -/* { dg-final { scan-assembler-times "fcmp\t(.)+0\\.0" 2 } } */ > +/* { dg-final { scan-assembler-times "fcmpe\t(?:.)+0\\.0" 1 } } */ > +/* { dg-final { scan-assembler-times "fcmp\t(?:.)+0\\.0" 1 } } */ > > /* { dg-final { scan-assembler "adds\t" } } */ > /* { dg-final { scan-assembler-times "\tccmp\t" 11 } } */
On Wed, 22 Nov 2023, Richard Earnshaw (lists) wrote: > > Use non-capturing parentheses for the subexpressions used with > > `scan-assembler-times', to avoid a quirk with double-counting. > > > > gcc/testsuite/ > > * gcc.target/aarch64/ccmp_1.c: Use non-capturing parentheses > > with `scan-assembler-times'. > > OK Thank you for your review. I have applied all the three changes now. Maciej
Index: gcc/gcc/testsuite/gcc.target/aarch64/ccmp_1.c =================================================================== --- gcc.orig/gcc/testsuite/gcc.target/aarch64/ccmp_1.c +++ gcc/gcc/testsuite/gcc.target/aarch64/ccmp_1.c @@ -86,8 +86,8 @@ f13 (int a, int b) /* { dg-final { scan-assembler "cmp\t(.)+35" } } */ /* { dg-final { scan-assembler-times "\tcmp\tw\[0-9\]+, 0" 4 } } */ -/* { dg-final { scan-assembler-times "fcmpe\t(.)+0\\.0" 2 } } */ -/* { dg-final { scan-assembler-times "fcmp\t(.)+0\\.0" 2 } } */ +/* { dg-final { scan-assembler-times "fcmpe\t(?:.)+0\\.0" 1 } } */ +/* { dg-final { scan-assembler-times "fcmp\t(?:.)+0\\.0" 1 } } */ /* { dg-final { scan-assembler "adds\t" } } */ /* { dg-final { scan-assembler-times "\tccmp\t" 11 } } */