This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix mpx testcases (Re: [CHKP] Fix for PR79990)


On Tue, May 09, 2017 at 03:29:40PM +0200, Alexander Ivchenko wrote:
> 2017-05-09  Alexander Ivchenko  <aivchenk@gmail.com>
> 
>         * gcc.target/i386/mpx/hard-reg-2-lbv.c: New test.
>         * gcc.target/i386/mpx/hard-reg-2-nov.c: New test.
>         * gcc.target/i386/mpx/hard-reg-2-ubv.c: New test.

These tests fail for me on i686, without -msse2 there is no
"xmm0" register one can use.

The following patch fixes it, tested on x86_64-linux and i686-linux,
ok for trunk?

2017-06-08  Jakub Jelinek  <jakub@redhat.com>

	* gcc.target/i386/mpx/hard-reg-1-nov.c (mpx_test): Use "esp"
	instead of "rsp" for -m32.
	* gcc.target/i386/mpx/hard-reg-2-lbv.c: Require sse2_runtime effective
	target, add -msse2 to dg-options.
	* gcc.target/i386/mpx/hard-reg-2-nov.c: Likewise.
	* gcc.target/i386/mpx/hard-reg-2-ubv.c: Likewise.

--- gcc/testsuite/gcc.target/i386/mpx/hard-reg-1-nov.c.jj	2015-03-10 16:56:41.000000000 +0100
+++ gcc/testsuite/gcc.target/i386/mpx/hard-reg-1-nov.c	2017-06-08 21:37:00.357993146 +0200
@@ -13,7 +13,11 @@ int rd (int *p, int i)
 
 int mpx_test (int argc, const char **argv)
 {
+#ifdef __x86_64__
   register int *frame __asm__("rsp");
+#else
+  register int *frame __asm__("esp");
+#endif
   rd (frame, 1);
 
   return 0;
--- gcc/testsuite/gcc.target/i386/mpx/hard-reg-2-lbv.c.jj	2017-06-08 17:53:25.000000000 +0200
+++ gcc/testsuite/gcc.target/i386/mpx/hard-reg-2-lbv.c	2017-06-08 21:37:23.772718716 +0200
@@ -1,6 +1,6 @@
-/* { dg-do run } */
+/* { dg-do run { target sse2_runtime } } */
 /* { dg-shouldfail "bounds violation" } */
-/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -msse2" } */
 
 
 #define SHOULDFAIL
--- gcc/testsuite/gcc.target/i386/mpx/hard-reg-2-nov.c.jj	2017-06-08 17:53:25.000000000 +0200
+++ gcc/testsuite/gcc.target/i386/mpx/hard-reg-2-nov.c	2017-06-08 21:37:35.517581062 +0200
@@ -1,5 +1,5 @@
-/* { dg-do run } */
-/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+/* { dg-do run { target sse2_runtime } } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -msse2" } */
 
 #include "mpx-check.h"
 
--- gcc/testsuite/gcc.target/i386/mpx/hard-reg-2-ubv.c.jj	2017-06-08 17:53:25.000000000 +0200
+++ gcc/testsuite/gcc.target/i386/mpx/hard-reg-2-ubv.c	2017-06-08 21:37:49.910412372 +0200
@@ -1,6 +1,6 @@
-/* { dg-do run } */
+/* { dg-do run { target sse2_runtime } } */
 /* { dg-shouldfail "bounds violation" } */
-/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -msse2" } */
 
 
 #define SHOULDFAIL


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]