[2/2] MIPS/GCC/testsuite: Fix data-sym-pool.c for n64 code

Message ID alpine.DEB.2.00.1804111435460.1545@tp.orcam.me.uk
State Accepted
Headers show
Series
  • MIPS/GCC/testsuite: Fixes for data-sym-pool.c
Related show

Commit Message

Maciej W. Rozycki April 11, 2018, 1:52 p.m.
With the soft-float n64 ABI and the data-sym-pool.c test case code like 
below is produced:

	.file	1 "data-sym-pool.c"
	.section .mdebug.abi64
	.previous
	.nan	legacy
	.module	softfloat
	.module	oddspreg
	.abicalls
	.option	pic0
	.text
	.align	2
	.globl	frob
	.set	mips16
	.set	nomicromips
	.ent	frob
	.type	frob, @function
frob:
	.frame	$17,16,$31		# vars= 0, regs= 1/0, args= 0, gp= 0
	.mask	0x00020000,-8
	.fmask	0x00000000,0
	daddiu	$sp,-16
	sd	$17,8($sp)
	move	$17,$sp
	ld	$2,.L3
	move	$sp,$17
	ld	$17,8($sp)
	daddiu	$sp,16
	jr	$31
	.type	__pool_frob_3, @object
__pool_frob_3:
	.align	3
.L3:
	.dword	305419896
	.type	__pend_frob_3, @function
__pend_frob_3:
	.insn
	.end	frob
	.size	frob, .-frob
	.ident	"GCC: (GNU) 8.0.1 20180410 (experimental)"

(we have no support for hard-float n64 MIPS16 code generation), which 
means that the test case will fail, as the regular expression pattern 
expects `lw' and `.word' rather than `ld' and `.dword' respectively to 
appear in assembly code generation.  Correct the pattern in an obvious 
way then making it accept both intructions and pseudo-ops.

	gcc/testsuite/
	* gcc.target/mips/data-sym-pool.c (dg-options): Match `ld' and
	`.dword' in addition to `lw' and `.word'.
---
Hi,

 I have regression-tested this with the `mips-mti-linux-gnu' target and 
the o32 ABI.  I don't have an n64 soft-float multilib configured, so the 
manually generated assembly file included with the description serves as 
the proof for what needs to be matched.

 OK to apply?

  Maciej
---
 gcc/testsuite/gcc.target/mips/data-sym-pool.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

gcc-mips16-test-data-sym-pool-dword.diff

Comments

Matthew Fortune April 18, 2018, 3:07 p.m. | #1
Maciej Rozycki <Maciej.Rozycki@mips.com> writes:
> (we have no support for hard-float n64 MIPS16 code generation), which
> means that the test case will fail, as the regular expression pattern
> expects `lw' and `.word' rather than `ld' and `.dword' respectively to
> appear in assembly code generation.  Correct the pattern in an obvious
> way then making it accept both intructions and pseudo-ops.
> 
> 	gcc/testsuite/
> 	* gcc.target/mips/data-sym-pool.c (dg-options): Match `ld' and
> 	`.dword' in addition to `lw' and `.word'.
> ---
> Hi,
> 
>  I have regression-tested this with the `mips-mti-linux-gnu' target and
> the o32 ABI.  I don't have an n64 soft-float multilib configured, so the
> manually generated assembly file included with the description serves as
> the proof for what needs to be matched.
> 
>  OK to apply?

Hi Maciej,

Apologies as before on slowness. This looks trivially OK to me but that's
thanks to the description, much appreciated.

OK for commit but adding RMs given the imminent release.

Thanks,
Matthew
Maciej W. Rozycki April 26, 2018, 9:12 p.m. | #2
On Wed, 18 Apr 2018, Matthew Fortune wrote:

> Apologies as before on slowness. This looks trivially OK to me but that's
> thanks to the description, much appreciated.

 You are welcome, that just means I did my homework right.

> OK for commit but adding RMs given the imminent release.

 Applied to trunk, now that GCC 8 has branched.  Thanks for your review.

  Maciej

Patch

Index: gcc/gcc/testsuite/gcc.target/mips/data-sym-pool.c
===================================================================
--- gcc.orig/gcc/testsuite/gcc.target/mips/data-sym-pool.c	2018-04-10 23:27:49.000000000 +0100
+++ gcc/gcc/testsuite/gcc.target/mips/data-sym-pool.c	2018-04-10 23:37:05.357453843 +0100
@@ -26,4 +26,4 @@  __pend_frob_3:					# The symbol must mat
    symbol from being placed in the constant pool at `-O0' for SVR4 code
    and consequently interfering with test expectations.  */
 
-/* { dg-final { scan-assembler "\tlw\t\\\$\[0-9\]+,(.L(\[0-9\]+))\n.*\t\\.type\t(__pool_frob_\\2), @object\n\\3:\n\t\\.align\t2\n\\1:\n\t\\.word\t305419896\n\t\\.type\t(__pend_frob_\\2), @function\n\\4:\n\t\\.insn\n" } } */
+/* { dg-final { scan-assembler "\tl\[wd\]\t\\\$\[0-9\]+,(.L(\[0-9\]+))\n.*\t\\.type\t(__pool_frob_\\2), @object\n\\3:\n\t\\.align\t2\n\\1:\n\t\\.d?word\t305419896\n\t\\.type\t(__pend_frob_\\2), @function\n\\4:\n\t\\.insn\n" } } */