public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, PR target/65602] Fix check_effective_target_mpx to check lib availability
@ 2015-03-30 14:01 Ilya Enkovich
  2015-03-30 20:10 ` Jeff Law
  0 siblings, 1 reply; 4+ messages in thread
From: Ilya Enkovich @ 2015-03-30 14:01 UTC (permalink / raw)
  To: gcc-patches

Hi,

Currently check_effective_target_mpx doesn't check libs availability for non Linux targets but tests require them.  This patch modifies test to requre wrappers library to link.  I suppose it should fix failing tests on Solaris and other non-Linux systems.  Patch also replaces alloca calls with __builtin_alloca calls.  Have no machine to test it though (Linux testing is OK).  Any help with testing?  Does it look OK?

Thanks,
Ilya
--
2015-03-30  Ilya Enkovich  <ilya.enkovich@intel.com>

	PR target/65602
	* gcc.target/i386/mpx/alloca-1-lbv.c (mpx_test): Use
	__builtin_alloca instead of alloca.
	* gcc.target/i386/mpx/alloca-1-nov.c (mpx_test): Likewise.
	* gcc.target/i386/mpx/alloca-1-ubv.c (mpx_test): Likewise.
	* lib/mpx-dg.exp (check_effective_target_mpx): Add wrapper
	check.


diff --git a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-lbv.c b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-lbv.c
index f81a5e2..57c05d3 100644
--- a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-lbv.c
+++ b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-lbv.c
@@ -16,7 +16,7 @@ int rd (int *p, int i)
 
 int mpx_test (int argc, const char **argv)
 {
-  int *buf = (int *)alloca (100 * sizeof(int));
+  int *buf = (int *)__buitlin_alloca (100 * sizeof(int));
 
   rd (buf, -1);
 
diff --git a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-nov.c b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-nov.c
index 162b4d5..835015f 100644
--- a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-nov.c
+++ b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-nov.c
@@ -13,7 +13,7 @@ int rd (int *p, int i)
 
 int mpx_test (int argc, const char **argv)
 {
-  int *buf = (int *)alloca (100 * sizeof(int));
+  int *buf = (int *)__builtin_alloca (100 * sizeof(int));
 
   rd (buf, 0);
   rd (buf, 99);
diff --git a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-ubv.c b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-ubv.c
index 9af3f11..c57c6c4 100644
--- a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-ubv.c
+++ b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-ubv.c
@@ -16,7 +16,7 @@ int rd (int *p, int i)
 
 int mpx_test (int argc, const char **argv)
 {
-  int *buf = (int *)alloca (100 * sizeof(int));
+  int *buf = (int *)__builtin_alloca (100 * sizeof(int));
 
   rd (buf, 100);
 
diff --git a/gcc/testsuite/lib/mpx-dg.exp b/gcc/testsuite/lib/mpx-dg.exp
index 0b731a7..c8f64cd 100644
--- a/gcc/testsuite/lib/mpx-dg.exp
+++ b/gcc/testsuite/lib/mpx-dg.exp
@@ -20,7 +20,13 @@
 proc check_effective_target_mpx {} {
     return [check_no_compiler_messages mpx executable {
 	int *foo (int *arg) { return arg; }
-	int main (void) { return foo ((void *)0) == 0; }
+	int main (void)
+	{
+	    int *p = __builtin_malloc (sizeof (int));
+	    int res = foo (p) == 0;
+	    __builtin_free (p);
+	    return res;
+	}
     } "-fcheck-pointer-bounds -mmpx"]
 }
 

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

* Re: [PATCH, PR target/65602] Fix check_effective_target_mpx to check lib availability
  2015-03-30 14:01 [PATCH, PR target/65602] Fix check_effective_target_mpx to check lib availability Ilya Enkovich
@ 2015-03-30 20:10 ` Jeff Law
  2015-03-30 20:30   ` Rainer Orth
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Law @ 2015-03-30 20:10 UTC (permalink / raw)
  To: Ilya Enkovich, gcc-patches

On 03/30/2015 08:00 AM, Ilya Enkovich wrote:
> Hi,
>
> Currently check_effective_target_mpx doesn't check libs availability for non Linux targets but tests require them.  This patch modifies test to requre wrappers library to link.  I suppose it should fix failing tests on Solaris and other non-Linux systems.  Patch also replaces alloca calls with __builtin_alloca calls.  Have no machine to test it though (Linux testing is OK).  Any help with testing?  Does it look OK?
>
> Thanks,
> Ilya
> --
> 2015-03-30  Ilya Enkovich  <ilya.enkovich@intel.com>
>
> 	PR target/65602
> 	* gcc.target/i386/mpx/alloca-1-lbv.c (mpx_test): Use
> 	__builtin_alloca instead of alloca.
> 	* gcc.target/i386/mpx/alloca-1-nov.c (mpx_test): Likewise.
> 	* gcc.target/i386/mpx/alloca-1-ubv.c (mpx_test): Likewise.
> 	* lib/mpx-dg.exp (check_effective_target_mpx): Add wrapper
> 	check.
Seems reasonable to me, given it's all MPX bits, you can self-approve. 
You might ping Rainer Orth  to see if he can test on x86 Solaris or 
something similar.

Jeff

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

* Re: [PATCH, PR target/65602] Fix check_effective_target_mpx to check lib availability
  2015-03-30 20:10 ` Jeff Law
@ 2015-03-30 20:30   ` Rainer Orth
  2015-03-31  8:27     ` Ilya Enkovich
  0 siblings, 1 reply; 4+ messages in thread
From: Rainer Orth @ 2015-03-30 20:30 UTC (permalink / raw)
  To: Jeff Law; +Cc: Ilya Enkovich, gcc-patches

Jeff Law <law@redhat.com> writes:

> On 03/30/2015 08:00 AM, Ilya Enkovich wrote:
>> Hi,
>>
>> Currently check_effective_target_mpx doesn't check libs availability for
>> non Linux targets but tests require them.  This patch modifies test to
>> requre wrappers library to link.  I suppose it should fix failing tests
>> on Solaris and other non-Linux systems.  Patch also replaces alloca calls
>> with __builtin_alloca calls.  Have no machine to test it though (Linux
>> testing is OK).  Any help with testing?  Does it look OK?
>>
>> Thanks,
>> Ilya
>> --
>> 2015-03-30  Ilya Enkovich  <ilya.enkovich@intel.com>
>>
>> 	PR target/65602
>> 	* gcc.target/i386/mpx/alloca-1-lbv.c (mpx_test): Use
>> 	__builtin_alloca instead of alloca.
>> 	* gcc.target/i386/mpx/alloca-1-nov.c (mpx_test): Likewise.
>> 	* gcc.target/i386/mpx/alloca-1-ubv.c (mpx_test): Likewise.
>> 	* lib/mpx-dg.exp (check_effective_target_mpx): Add wrapper
>> 	check.
> Seems reasonable to me, given it's all MPX bits, you can self-approve. You
> might ping Rainer Orth  to see if he can test on x86 Solaris or something
> similar.

I originally reported the bug and did test the patch over the weekend:
the Solaris/x86 testsuite failures are gone, so that part is fine.  I
couldn't of course test the alloca -> __builtin_alloca change since the
tests aren't built at all.

I don't have a baseline for Linux/x86_64 without --enable-libmpx (the
default) to compare against, but see in the gcc.log file that the mpx
tests aren't run in that config due to missing -lmpx -lmpxwrappers.

I'd suggest (though this is stage1 material) to split the mpx tests into
compile (requiring an assembler with mpx support) and link/run
(also requiring the runtime libs) tests to extend test coverage.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

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

* Re: [PATCH, PR target/65602] Fix check_effective_target_mpx to check lib availability
  2015-03-30 20:30   ` Rainer Orth
@ 2015-03-31  8:27     ` Ilya Enkovich
  0 siblings, 0 replies; 4+ messages in thread
From: Ilya Enkovich @ 2015-03-31  8:27 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Jeff Law, gcc-patches

2015-03-30 23:30 GMT+03:00 Rainer Orth <ro@cebitec.uni-bielefeld.de>:
> I originally reported the bug and did test the patch over the weekend:
> the Solaris/x86 testsuite failures are gone, so that part is fine.  I
> couldn't of course test the alloca -> __builtin_alloca change since the
> tests aren't built at all.
>
> I don't have a baseline for Linux/x86_64 without --enable-libmpx (the
> default) to compare against, but see in the gcc.log file that the mpx
> tests aren't run in that config due to missing -lmpx -lmpxwrappers.

Thanks for testing!

>
> I'd suggest (though this is stage1 material) to split the mpx tests into
> compile (requiring an assembler with mpx support) and link/run
> (also requiring the runtime libs) tests to extend test coverage.

I don't see much reason to run compile mpx tests on targets where mpx
is not supported. I thinks it would be enough to just enable libmpx by
default on stage 1.

Thanks
Ilya

>
>         Rainer
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University

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

end of thread, other threads:[~2015-03-31  8:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-30 14:01 [PATCH, PR target/65602] Fix check_effective_target_mpx to check lib availability Ilya Enkovich
2015-03-30 20:10 ` Jeff Law
2015-03-30 20:30   ` Rainer Orth
2015-03-31  8:27     ` Ilya Enkovich

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