public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Revive test case PR 102957
@ 2023-08-11  9:11 Tsukasa OI
  2023-08-11 14:15 ` Jeff Law
  2023-08-29  3:28 ` [PATCH v2] RISC-V: Make PR 102957 tests more comprehensive Tsukasa OI
  0 siblings, 2 replies; 7+ messages in thread
From: Tsukasa OI @ 2023-08-11  9:11 UTC (permalink / raw)
  To: Tsukasa OI, Kito Cheng, Palmer Dabbelt, Andrew Waterman, Jim Wilson
  Cc: gcc-patches

From: Tsukasa OI <research_trasio@irq.a4lg.com>

Commit c283c4774d1c ("RISC-V: Throw compilation error for unknown
extensions") changed how do we handle unknown extensions and
commit 6f709f79c915a ("[committed] [RISC-V] Fix expected diagnostic messages
in testsuite") "fixed" test failures caused by that change (on pr102957.c,
by testing the error message after the first change).

However, the latter change will break the original intent of PR 102957 test
case because we wanted to make sure that we can parse a valid two-letter
extension name.

Fortunately, there is a valid two-letter extension name, 'Zk' (standard
scalar cryptography extension superset with NIST algorithm suite).

This commit puts this extension name and revives the intent of the test case
for PR 102957.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/pr102957.c: Remove "dg-error" because we don't
	need to test for error message.  Use the 'Zk' extension to continue
	testing whether we can use valid two-letter extensions.
---
 gcc/testsuite/gcc.target/riscv/pr102957.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/gcc/testsuite/gcc.target/riscv/pr102957.c b/gcc/testsuite/gcc.target/riscv/pr102957.c
index 5273ee6c5018..fe6241466354 100644
--- a/gcc/testsuite/gcc.target/riscv/pr102957.c
+++ b/gcc/testsuite/gcc.target/riscv/pr102957.c
@@ -1,7 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-march=rv64gzb -mabi=lp64" } */
+/* { dg-options "-march=rv64gzk -mabi=lp64" } */
 int foo()
 {
 }
-
-/* { dg-error "extension 'zb' starts with 'z' but is unsupported standard extension" "" { target *-*-* } 0 } */

base-commit: bcda361daaec8623c91d0dff3ea8e576373b5f50
-- 
2.41.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] RISC-V: Revive test case PR 102957
  2023-08-11  9:11 [PATCH] RISC-V: Revive test case PR 102957 Tsukasa OI
@ 2023-08-11 14:15 ` Jeff Law
  2023-08-11 14:29   ` Tsukasa OI
  2023-08-29  3:28 ` [PATCH v2] RISC-V: Make PR 102957 tests more comprehensive Tsukasa OI
  1 sibling, 1 reply; 7+ messages in thread
From: Jeff Law @ 2023-08-11 14:15 UTC (permalink / raw)
  To: Tsukasa OI, Kito Cheng, Palmer Dabbelt, Andrew Waterman, Jim Wilson
  Cc: gcc-patches



On 8/11/23 03:11, Tsukasa OI via Gcc-patches wrote:
> From: Tsukasa OI <research_trasio@irq.a4lg.com>
> 
> Commit c283c4774d1c ("RISC-V: Throw compilation error for unknown
> extensions") changed how do we handle unknown extensions and
> commit 6f709f79c915a ("[committed] [RISC-V] Fix expected diagnostic messages
> in testsuite") "fixed" test failures caused by that change (on pr102957.c,
> by testing the error message after the first change).
> 
> However, the latter change will break the original intent of PR 102957 test
> case because we wanted to make sure that we can parse a valid two-letter
> extension name.
> 
> Fortunately, there is a valid two-letter extension name, 'Zk' (standard
> scalar cryptography extension superset with NIST algorithm suite).
> 
> This commit puts this extension name and revives the intent of the test case
> for PR 102957.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.target/riscv/pr102957.c: Remove "dg-error" because we don't
> 	need to test for error message.  Use the 'Zk' extension to continue
> 	testing whether we can use valid two-letter extensions.
This doesn't look right to me.  The whole point of this specific dg line 
is to verify that we get an error with an invalid extension specification.

What might make more sense would be to split this into two tests.  One 
which continues to test that we get an error for something like zb and 
the other with everything else.

jeff

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] RISC-V: Revive test case PR 102957
  2023-08-11 14:15 ` Jeff Law
@ 2023-08-11 14:29   ` Tsukasa OI
  2023-08-28 22:01     ` Jeff Law
  0 siblings, 1 reply; 7+ messages in thread
From: Tsukasa OI @ 2023-08-11 14:29 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches

On 2023/08/11 23:15, Jeff Law wrote:
> 
> 
> On 8/11/23 03:11, Tsukasa OI via Gcc-patches wrote:
>> From: Tsukasa OI <research_trasio@irq.a4lg.com>
>>
>> Commit c283c4774d1c ("RISC-V: Throw compilation error for unknown
>> extensions") changed how do we handle unknown extensions and
>> commit 6f709f79c915a ("[committed] [RISC-V] Fix expected diagnostic
>> messages
>> in testsuite") "fixed" test failures caused by that change (on
>> pr102957.c,
>> by testing the error message after the first change).
>>
>> However, the latter change will break the original intent of PR 102957
>> test
>> case because we wanted to make sure that we can parse a valid two-letter
>> extension name.
>>
>> Fortunately, there is a valid two-letter extension name, 'Zk' (standard
>> scalar cryptography extension superset with NIST algorithm suite).
>>
>> This commit puts this extension name and revives the intent of the
>> test case
>> for PR 102957.
>>
>> gcc/testsuite/ChangeLog:
>>
>>     * gcc.target/riscv/pr102957.c: Remove "dg-error" because we don't
>>     need to test for error message.  Use the 'Zk' extension to continue
>>     testing whether we can use valid two-letter extensions.
> This doesn't look right to me.  The whole point of this specific dg line
> is to verify that we get an error with an invalid extension specification.
> 
> What might make more sense would be to split this into two tests.  One
> which continues to test that we get an error for something like zb and
> the other with everything else.
> 
> jeff
> 

Originally, it tested that a two letter extension ('Zb') is accepted by
GCC (because the background of PR 102957 was GCC assumed multi-letter
'Z' extensions are three letters or more).

After rejecting unrecognized extensions, "dg-error" is added **just to
avoid the test failure** and that doesn't look right.  Yes, we now don't
have an ICE (like in the original report) but after the PR 102957 fix,
we just accepted it, not rejecting it.

Instead, we have a valid (recognized) two-letter 'Z' extension: 'Zk'.  I
think replacing "zb" with "zk" is more correct considering the original
bug report (PR 102957) and its assumption.

cf. <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102957>

Regards,
Tsukasa

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] RISC-V: Revive test case PR 102957
  2023-08-11 14:29   ` Tsukasa OI
@ 2023-08-28 22:01     ` Jeff Law
  2023-08-29  2:12       ` Tsukasa OI
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Law @ 2023-08-28 22:01 UTC (permalink / raw)
  To: Tsukasa OI; +Cc: gcc-patches



On 8/11/23 08:29, Tsukasa OI wrote:
> On 2023/08/11 23:15, Jeff Law wrote:

>>
> 
> Originally, it tested that a two letter extension ('Zb') is accepted by
> GCC (because the background of PR 102957 was GCC assumed multi-letter
> 'Z' extensions are three letters or more).
> 
> After rejecting unrecognized extensions, "dg-error" is added **just to
> avoid the test failure** and that doesn't look right.  Yes, we now don't
> have an ICE (like in the original report) but after the PR 102957 fix,
> we just accepted it, not rejecting it.
> 
> Instead, we have a valid (recognized) two-letter 'Z' extension: 'Zk'.  I
> think replacing "zb" with "zk" is more correct considering the original
> bug report (PR 102957) and its assumption.
> 
> cf. <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102957>
Thanks.  It still seems to me we want to  have two tests here.

I would suggest leaving pr102957.c alone since that tests that we give a 
proper error for "zb".  Then create a new test that verifies "zk" is 
accepted without error.

jeff

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] RISC-V: Revive test case PR 102957
  2023-08-28 22:01     ` Jeff Law
@ 2023-08-29  2:12       ` Tsukasa OI
  0 siblings, 0 replies; 7+ messages in thread
From: Tsukasa OI @ 2023-08-29  2:12 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches

On 2023/08/29 7:01, Jeff Law wrote:
> 
> 
> On 8/11/23 08:29, Tsukasa OI wrote:
>> On 2023/08/11 23:15, Jeff Law wrote:
> 
>>>
>>
>> Originally, it tested that a two letter extension ('Zb') is accepted by
>> GCC (because the background of PR 102957 was GCC assumed multi-letter
>> 'Z' extensions are three letters or more).
>>
>> After rejecting unrecognized extensions, "dg-error" is added **just to
>> avoid the test failure** and that doesn't look right.  Yes, we now don't
>> have an ICE (like in the original report) but after the PR 102957 fix,
>> we just accepted it, not rejecting it.
>>
>> Instead, we have a valid (recognized) two-letter 'Z' extension: 'Zk'.  I
>> think replacing "zb" with "zk" is more correct considering the original
>> bug report (PR 102957) and its assumption.
>>
>> cf. <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102957>
> Thanks.  It still seems to me we want to  have two tests here.
> 
> I would suggest leaving pr102957.c alone since that tests that we give a
> proper error for "zb".  Then create a new test that verifies "zk" is
> accepted without error.
> 
> jeff
> 

Okay, that's a great compromise.

I will make v2 to add pr102957-2.c (like so) to reflect my intention and
keep the original pr102957.c.

Thanks,
Tsukasa

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] RISC-V: Make PR 102957 tests more comprehensive
  2023-08-11  9:11 [PATCH] RISC-V: Revive test case PR 102957 Tsukasa OI
  2023-08-11 14:15 ` Jeff Law
@ 2023-08-29  3:28 ` Tsukasa OI
  2023-08-29 13:44   ` Jeff Law
  1 sibling, 1 reply; 7+ messages in thread
From: Tsukasa OI @ 2023-08-29  3:28 UTC (permalink / raw)
  To: Tsukasa OI, Kito Cheng, Palmer Dabbelt, Andrew Waterman,
	Jim Wilson, Jeff Law
  Cc: gcc-patches

From: Tsukasa OI <research_trasio@irq.a4lg.com>

Commit c283c4774d1c ("RISC-V: Throw compilation error for unknown
extensions") changed how do we handle unknown extensions and
commit 6f709f79c915a ("[committed] [RISC-V] Fix expected diagnostic messages
in testsuite") "fixed" test failures caused by that change (on pr102957.c,
by testing the error message after the first change).

However, the latter change will partially break the original intent of PR
102957 test case because we wanted to make sure that we can parse a valid
two-letter extension name.

Fortunately, there is a valid two-letter extension name, 'Zk' (standard
scalar cryptography extension superset with NIST algorithm suite).

This commit adds pr102957-2.c to make sure that there will be no errors if
we parse a valid two-letter extension name.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/pr102957-2.c: New test case using the 'Zk'
	extension to continue testing whether we can use valid two-letter
	extensions.
---
 gcc/testsuite/gcc.target/riscv/pr102957-2.c | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/riscv/pr102957-2.c

diff --git a/gcc/testsuite/gcc.target/riscv/pr102957-2.c b/gcc/testsuite/gcc.target/riscv/pr102957-2.c
new file mode 100644
index 000000000000..fe6241466354
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/pr102957-2.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gzk -mabi=lp64" } */
+int foo()
+{
+}

base-commit: 818cc9f2d2f3dbbd4004ff85d3125d92d1e430c9
-- 
2.42.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] RISC-V: Make PR 102957 tests more comprehensive
  2023-08-29  3:28 ` [PATCH v2] RISC-V: Make PR 102957 tests more comprehensive Tsukasa OI
@ 2023-08-29 13:44   ` Jeff Law
  0 siblings, 0 replies; 7+ messages in thread
From: Jeff Law @ 2023-08-29 13:44 UTC (permalink / raw)
  To: Tsukasa OI, Kito Cheng, Palmer Dabbelt, Andrew Waterman, Jim Wilson
  Cc: gcc-patches



On 8/28/23 21:28, Tsukasa OI wrote:
> From: Tsukasa OI <research_trasio@irq.a4lg.com>
> 
> Commit c283c4774d1c ("RISC-V: Throw compilation error for unknown
> extensions") changed how do we handle unknown extensions and
> commit 6f709f79c915a ("[committed] [RISC-V] Fix expected diagnostic messages
> in testsuite") "fixed" test failures caused by that change (on pr102957.c,
> by testing the error message after the first change).
> 
> However, the latter change will partially break the original intent of PR
> 102957 test case because we wanted to make sure that we can parse a valid
> two-letter extension name.
> 
> Fortunately, there is a valid two-letter extension name, 'Zk' (standard
> scalar cryptography extension superset with NIST algorithm suite).
> 
> This commit adds pr102957-2.c to make sure that there will be no errors if
> we parse a valid two-letter extension name.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.target/riscv/pr102957-2.c: New test case using the 'Zk'
> 	extension to continue testing whether we can use valid two-letter
> 	extensions.
OK
jeff

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-29 13:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-11  9:11 [PATCH] RISC-V: Revive test case PR 102957 Tsukasa OI
2023-08-11 14:15 ` Jeff Law
2023-08-11 14:29   ` Tsukasa OI
2023-08-28 22:01     ` Jeff Law
2023-08-29  2:12       ` Tsukasa OI
2023-08-29  3:28 ` [PATCH v2] RISC-V: Make PR 102957 tests more comprehensive Tsukasa OI
2023-08-29 13:44   ` Jeff Law

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).