RISC-V: Make stack_save_restore_2 more robust

Message ID 20231027175650.1361174-1-patrick@rivosinc.com
State Unresolved
Headers
Series RISC-V: Make stack_save_restore_2 more robust |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Patrick O'Neill Oct. 27, 2023, 5:56 p.m. UTC
  GCC recently changed to emit __riscv_restore_5 which causes this
testcase to fail.
This patch updates the regex to be more robust to change by accepting
any number after __riscv_save_ and __riscv_restore_.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/stack_save_restore_2.c: Accept any number
	after __riscv_save_ and __riscv_restore_.

Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
---
Tested using glibc rv64gc on r14-4980-g2672c60917d.
---
 gcc/testsuite/gcc.target/riscv/stack_save_restore_2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Jeff Law Oct. 27, 2023, 6:02 p.m. UTC | #1
On 10/27/23 11:56, Patrick O'Neill wrote:
> GCC recently changed to emit __riscv_restore_5 which causes this
> testcase to fail.
> This patch updates the regex to be more robust to change by accepting
> any number after __riscv_save_ and __riscv_restore_.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.target/riscv/stack_save_restore_2.c: Accept any number
> 	after __riscv_save_ and __riscv_restore_.
OK
jeff
  
Patrick O'Neill Oct. 27, 2023, 6:14 p.m. UTC | #2
On 10/27/23 11:02, Jeff Law wrote:
>
>
> On 10/27/23 11:56, Patrick O'Neill wrote:
>> GCC recently changed to emit __riscv_restore_5 which causes this
>> testcase to fail.
>> This patch updates the regex to be more robust to change by accepting
>> any number after __riscv_save_ and __riscv_restore_.
>>
>> gcc/testsuite/ChangeLog:
>>
>>     * gcc.target/riscv/stack_save_restore_2.c: Accept any number
>>     after __riscv_save_ and __riscv_restore_.
> OK
> jeff

Committed

Patrick
  

Patch

diff --git a/gcc/testsuite/gcc.target/riscv/stack_save_restore_2.c b/gcc/testsuite/gcc.target/riscv/stack_save_restore_2.c
index 4c549cb11ae..5f0389243b1 100644
--- a/gcc/testsuite/gcc.target/riscv/stack_save_restore_2.c
+++ b/gcc/testsuite/gcc.target/riscv/stack_save_restore_2.c
@@ -7,7 +7,7 @@  float getf();
 
 /*
 ** bar:
-**	call	t0,__riscv_save_(3|4)
+**	call	t0,__riscv_save_[0-9]+
 **	addi	sp,sp,-[0-9]+
 **	...
 **	li	t0,-[0-9]+
@@ -17,7 +17,7 @@  float getf();
 **	add	sp,sp,t0
 **	...
 **	addi	sp,sp,[0-9]+
-**	tail	__riscv_restore_(3|4)
+**	tail	__riscv_restore_[0-9]+
 */
 int bar()
 {