* [PATCH] AArch64/testsuite: Use non-capturing parentheses with ccmp_1.c
@ 2023-11-22 15:21 Maciej W. Rozycki
2023-11-22 16:18 ` Richard Earnshaw (lists)
0 siblings, 1 reply; 3+ messages in thread
From: Maciej W. Rozycki @ 2023-11-22 15:21 UTC (permalink / raw)
To: gcc-patches
Cc: Richard Earnshaw, Richard Sandiford, Marcus Shawcroft,
Kyrylo Tkachov, Jeff Law
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'.
---
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 } } */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] AArch64/testsuite: Use non-capturing parentheses with ccmp_1.c
2023-11-22 15:21 [PATCH] AArch64/testsuite: Use non-capturing parentheses with ccmp_1.c Maciej W. Rozycki
@ 2023-11-22 16:18 ` Richard Earnshaw (lists)
2023-11-23 16:20 ` Maciej W. Rozycki
0 siblings, 1 reply; 3+ messages in thread
From: Richard Earnshaw (lists) @ 2023-11-22 16:18 UTC (permalink / raw)
To: Maciej W. Rozycki, gcc-patches
Cc: Richard Sandiford, Marcus Shawcroft, Kyrylo Tkachov, Jeff Law
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 } } */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] AArch64/testsuite: Use non-capturing parentheses with ccmp_1.c
2023-11-22 16:18 ` Richard Earnshaw (lists)
@ 2023-11-23 16:20 ` Maciej W. Rozycki
0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2023-11-23 16:20 UTC (permalink / raw)
To: Richard Earnshaw (lists)
Cc: gcc-patches, Richard Sandiford, Marcus Shawcroft, Kyrylo Tkachov,
Jeff Law
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-11-23 16:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-22 15:21 [PATCH] AArch64/testsuite: Use non-capturing parentheses with ccmp_1.c Maciej W. Rozycki
2023-11-22 16:18 ` Richard Earnshaw (lists)
2023-11-23 16:20 ` Maciej W. Rozycki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).