public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH,testsuite] MIPS: Fix register mode checking for n64 in pr68273.c.
@ 2017-03-02 17:06 Toma Tabacu
  2017-03-02 21:30 ` Matthew Fortune
  0 siblings, 1 reply; 3+ messages in thread
From: Toma Tabacu @ 2017-03-02 17:06 UTC (permalink / raw)
  To: gcc-patches; +Cc: Matthew Fortune, catherine_moore

Hi,

pr68273.c currently fails when targeting MIPS64 with the n64 ABI.
This is because it is checking for some registers in SImode, but, because of
n64, they will actually be in DImode.

This patch restricts matching for SImode registers to ilp32 targets and adds
matching for DImode registers for lp64 targets.
This makes sure that the test is run on as many targets as possible, compared
to the alternative of adding -mabi=32 to the test options.

I haven't checked to see what happens with eabi or o64, though.

Does this approach work ? Or should I just make separate tests for o32, n32 and
n64, each one using -mabi=* as a test option to force an ABI ?

Tested with mips-mti-elf.

Regards,
Toma

gcc/testsuite/

	* gcc.target/mips/pr68273.c (dg-final): Match SImode registers only for
	ilp32 targets and match DImode registers for lp64 targets.

diff --git a/gcc/testsuite/gcc.target/mips/pr68273.c b/gcc/testsuite/gcc.target/mips/pr68273.c
index cbe81e1..ce8ca93 100644
--- a/gcc/testsuite/gcc.target/mips/pr68273.c
+++ b/gcc/testsuite/gcc.target/mips/pr68273.c
@@ -75,5 +75,8 @@ op (Node q)
 }
 
 
-/* { dg-final { scan-rtl-dump-times "\\\(set \\\(reg:SI 5 \\\$5\\\)" 2 "expand" } }  */
-/* { dg-final { scan-rtl-dump-times "\\\(set \\\(reg:SI 6 \\\$6\\\)" 1 "expand" } }  */
+/* { dg-final { scan-rtl-dump-times "\\\(set \\\(reg:SI 5 \\\$5\\\)" 2 "expand" { target { ilp32 } } } }  */
+/* { dg-final { scan-rtl-dump-times "\\\(set \\\(reg:SI 6 \\\$6\\\)" 1 "expand" { target { ilp32 } } } }  */
+
+/* { dg-final { scan-rtl-dump-times "\\\(set \\\(reg:DI 5 \\\$5\\\)" 2 "expand" { target { lp64 } } } }  */
+/* { dg-final { scan-rtl-dump-times "\\\(set \\\(reg:DI 6 \\\$6\\\)" 1 "expand" { target { lp64 } } } }  */

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

* RE: [PATCH,testsuite] MIPS: Fix register mode checking for n64 in pr68273.c.
  2017-03-02 17:06 [PATCH,testsuite] MIPS: Fix register mode checking for n64 in pr68273.c Toma Tabacu
@ 2017-03-02 21:30 ` Matthew Fortune
  2017-03-03 13:26   ` Toma Tabacu
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Fortune @ 2017-03-02 21:30 UTC (permalink / raw)
  To: Toma Tabacu, gcc-patches; +Cc: catherine_moore

Toma Tabacu <Toma.Tabacu@imgtec.com> writes:
> pr68273.c currently fails when targeting MIPS64 with the n64 ABI.
> This is because it is checking for some registers in SImode, but, because of
> n64, they will actually be in DImode.
> 
> This patch restricts matching for SImode registers to ilp32 targets and adds
> matching for DImode registers for lp64 targets.
> This makes sure that the test is run on as many targets as possible, compared
> to the alternative of adding -mabi=32 to the test options.
> 
> I haven't checked to see what happens with eabi or o64, though.
> 
> Does this approach work ? Or should I just make separate tests for o32, n32 and
> n64, each one using -mabi=* as a test option to force an ABI ?

I'm happy with this approach.  As long as it works for o32/n32/n64 that is
sufficient right now.  If anyone starts to build and run the testsuite regularly
for default eabi/o64 then tests can be fixed which will involve much more than
just this one.

> Tested with mips-mti-elf.
> 
> Regards,
> Toma
> 
> gcc/testsuite/
> 
> 	* gcc.target/mips/pr68273.c (dg-final): Match SImode registers only for
> 	ilp32 targets and match DImode registers for lp64 targets.

OK, thanks.

Matthew

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

* RE: [PATCH,testsuite] MIPS: Fix register mode checking for n64 in pr68273.c.
  2017-03-02 21:30 ` Matthew Fortune
@ 2017-03-03 13:26   ` Toma Tabacu
  0 siblings, 0 replies; 3+ messages in thread
From: Toma Tabacu @ 2017-03-03 13:26 UTC (permalink / raw)
  To: Matthew Fortune, gcc-patches; +Cc: catherine_moore

> From: Matthew Fortune
> >
> > gcc/testsuite/
> >
> > 	* gcc.target/mips/pr68273.c (dg-final): Match SImode registers only for
> > 	ilp32 targets and match DImode registers for lp64 targets.
> 
> OK, thanks.
> 
> Matthew

Committed as r245874.

Thanks,
Toma

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

end of thread, other threads:[~2017-03-03 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-02 17:06 [PATCH,testsuite] MIPS: Fix register mode checking for n64 in pr68273.c Toma Tabacu
2017-03-02 21:30 ` Matthew Fortune
2017-03-03 13:26   ` Toma Tabacu

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