Re: [Patch ARM] Improve guality tests - part 1 - pr36728-1.c

2015-02-04 Thread Ramana Radhakrishnan

 Changelog:

 * gcc.dg/guality/pr36728-1.c: Skip some tests for arm.


Segher and I discussed an alternative approach - marking these as m
(arg1) , m (arg2)  etc in the asm blocks also gives us the same
effect and then probably removes the need to rely on such target
markers.  I've just noticed that the AArch64 port has the same issues.

I'll spin something up along those lines, maybe that is more acceptable

Ramana


Re: [Patch ARM] Improve guality tests - part 1 - pr36728-1.c

2015-02-04 Thread Jakub Jelinek
On Wed, Feb 04, 2015 at 11:33:19AM +, Ramana Radhakrishnan wrote:
 --- a/gcc/testsuite/gcc.dg/guality/pr36728-1.c
 +++ b/gcc/testsuite/gcc.dg/guality/pr36728-1.c
 @@ -49,5 +49,6 @@ main ()
int l = 0;
asm ( : =r (l) : 0 (l));
a = foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
 +  asm volatile (  : : r (l));

Please remove the space before .

 --- a/gcc/testsuite/gcc.dg/guality/pr36728-2.c
 +++ b/gcc/testsuite/gcc.dg/guality/pr36728-2.c
 @@ -49,5 +49,6 @@ main ()
int l = 0;
asm ( : =r (l) : 0 (l));
a = foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
 +  asm ( :  : r (l));

Please add volatile, and remove the extra space in between :  :

 --- a/gcc/testsuite/gcc.dg/guality/pr36728-3.c
 +++ b/gcc/testsuite/gcc.dg/guality/pr36728-3.c
 @@ -47,5 +47,6 @@ main ()
int l = 0;
asm volatile ( : =r (l) : 0 (l));
foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
 +  asm volatile (  : : r (l));

See the 1st comment.

 --- a/gcc/testsuite/gcc.dg/guality/pr36728-4.c
 +++ b/gcc/testsuite/gcc.dg/guality/pr36728-4.c
 @@ -47,5 +47,6 @@ main ()
int l = 0;
asm volatile ( : =r (l) : 0 (l));
foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
 +  asm volatile (  : r (l));

Likewise.  Also one : is missing, wonder how this could compile.

Jakub


Re: [Patch ARM] Improve guality tests - part 1 - pr36728-1.c

2015-02-04 Thread Jakub Jelinek
On Wed, Feb 04, 2015 at 11:03:29AM +, Ramana Radhakrishnan wrote:
 
  Changelog:
 
  * gcc.dg/guality/pr36728-1.c: Skip some tests for arm.
 
 
 Segher and I discussed an alternative approach - marking these as m
 (arg1) , m (arg2)  etc in the asm blocks also gives us the same
 effect and then probably removes the need to rely on such target
 markers.  I've just noticed that the AArch64 port has the same issues.

I don't think it is a good idea to significantly change the function being
tested.  Then it tests completely different thing from what it is meant to
test.
But in the pr36728-{1,2}.c case, perhaps you could instead change the
caller, by adding
  asm volatile ( : : r (l));
before return 0; in main, that way DW_OP_GNU_entry_value could work if there
is no other way to find the value of the arguments, because l will need to
live somewhere (in some register or memory) across the foo call.

Jakub


Re: [Patch ARM] Improve guality tests - part 1 - pr36728-1.c

2015-02-04 Thread Ramana Radhakrishnan



On 04/02/2015 11:10, Jakub Jelinek wrote:

On Wed, Feb 04, 2015 at 11:03:29AM +, Ramana Radhakrishnan wrote:


Changelog:

* gcc.dg/guality/pr36728-1.c: Skip some tests for arm.



Segher and I discussed an alternative approach - marking these as m
(arg1) , m (arg2)  etc in the asm blocks also gives us the same
effect and then probably removes the need to rely on such target
markers.  I've just noticed that the AArch64 port has the same issues.


I don't think it is a good idea to significantly change the function being
tested.  Then it tests completely different thing from what it is meant to
test.
But in the pr36728-{1,2}.c case, perhaps you could instead change the
caller, by adding
   asm volatile ( : : r (l));
before return 0; in main, that way DW_OP_GNU_entry_value could work if there
is no other way to find the value of the arguments, because l will need to
live somewhere (in some register or memory) across the foo call.


That's more elegant than marking them all as used - I didn't know 
about the DW_OP_GNU_entry_value extension. Pretty neat now that I've 
read about it. It seems to have fixed up all of these issues here.


I don't have access to s390 so I'm not about to revert the s390 bits in 
this particular case.



DATE  Jakub Jelinek  ja...@redhat.com
Ramana Radhakrishnan  ramana.radhakrish...@arm.com

	* gcc.dg/guality/pr36728-1.c (main): Adjust for targets that pass 
parameters in registers.

* gcc.dg/guality/pr36728-2.c: Likewise.
* gcc.dg/guality/pr36728-3.c: Likewise.
* gcc.dg/guality/pr36728-4.c: Likewise.

regards
Ramana



Jakub





diff --git a/gcc/testsuite/gcc.dg/guality/pr36728-1.c 
b/gcc/testsuite/gcc.dg/guality/pr36728-1.c
index ba7a6c2..962a38a 100644
--- a/gcc/testsuite/gcc.dg/guality/pr36728-1.c
+++ b/gcc/testsuite/gcc.dg/guality/pr36728-1.c
@@ -49,5 +49,6 @@ main ()
   int l = 0;
   asm ( : =r (l) : 0 (l));
   a = foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+  asm volatile (  : : r (l));
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr36728-2.c 
b/gcc/testsuite/gcc.dg/guality/pr36728-2.c
index 6daa021..636b968 100644
--- a/gcc/testsuite/gcc.dg/guality/pr36728-2.c
+++ b/gcc/testsuite/gcc.dg/guality/pr36728-2.c
@@ -49,5 +49,6 @@ main ()
   int l = 0;
   asm ( : =r (l) : 0 (l));
   a = foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+  asm ( :  : r (l));
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr36728-3.c 
b/gcc/testsuite/gcc.dg/guality/pr36728-3.c
index bb2c067..5be2cbd 100644
--- a/gcc/testsuite/gcc.dg/guality/pr36728-3.c
+++ b/gcc/testsuite/gcc.dg/guality/pr36728-3.c
@@ -47,5 +47,6 @@ main ()
   int l = 0;
   asm volatile ( : =r (l) : 0 (l));
   foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+  asm volatile (  : : r (l));
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr36728-4.c 
b/gcc/testsuite/gcc.dg/guality/pr36728-4.c
index fee79c4..a1cb093 100644
--- a/gcc/testsuite/gcc.dg/guality/pr36728-4.c
+++ b/gcc/testsuite/gcc.dg/guality/pr36728-4.c
@@ -47,5 +47,6 @@ main ()
   int l = 0;
   asm volatile ( : =r (l) : 0 (l));
   foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+  asm volatile (  : r (l));
   return 0;
 }


Re: [Patch ARM] Improve guality tests - part 1 - pr36728-1.c

2015-02-04 Thread Ramana Radhakrishnan



On 04/02/2015 11:40, Jakub Jelinek wrote:

On Wed, Feb 04, 2015 at 11:33:19AM +, Ramana Radhakrishnan wrote:

--- a/gcc/testsuite/gcc.dg/guality/pr36728-1.c
+++ b/gcc/testsuite/gcc.dg/guality/pr36728-1.c
@@ -49,5 +49,6 @@ main ()
int l = 0;
asm ( : =r (l) : 0 (l));
a = foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+  asm volatile (  : : r (l));


Please remove the space before .


--- a/gcc/testsuite/gcc.dg/guality/pr36728-2.c
+++ b/gcc/testsuite/gcc.dg/guality/pr36728-2.c
@@ -49,5 +49,6 @@ main ()
int l = 0;
asm ( : =r (l) : 0 (l));
a = foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+  asm ( :  : r (l));


Please add volatile, and remove the extra space in between :  :


--- a/gcc/testsuite/gcc.dg/guality/pr36728-3.c
+++ b/gcc/testsuite/gcc.dg/guality/pr36728-3.c
@@ -47,5 +47,6 @@ main ()
int l = 0;
asm volatile ( : =r (l) : 0 (l));
foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+  asm volatile (  : : r (l));


See the 1st comment.


--- a/gcc/testsuite/gcc.dg/guality/pr36728-4.c
+++ b/gcc/testsuite/gcc.dg/guality/pr36728-4.c
@@ -47,5 +47,6 @@ main ()
int l = 0;
asm volatile ( : =r (l) : 0 (l));
foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+  asm volatile (  : r (l));


Likewise.  Also one : is missing, wonder how this could compile.



Bah - only saw the reduction in testcases.

Now corrected and checked on armhf that number of tests failing reduces 
as expected and the pr36728-4.c test runs and shows no failures on 
arm-linux-gnueabihf


Applied with the changes suggested as r220398.

Ramana



Ramana


Jakub

diff --git a/gcc/testsuite/gcc.dg/guality/pr36728-1.c 
b/gcc/testsuite/gcc.dg/guality/pr36728-1.c
index ba7a6c2..0ab475a 100644
--- a/gcc/testsuite/gcc.dg/guality/pr36728-1.c
+++ b/gcc/testsuite/gcc.dg/guality/pr36728-1.c
@@ -49,5 +49,6 @@ main ()
   int l = 0;
   asm ( : =r (l) : 0 (l));
   a = foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+  asm volatile ( :: r (l));
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr36728-2.c 
b/gcc/testsuite/gcc.dg/guality/pr36728-2.c
index 6daa021..7ba8663 100644
--- a/gcc/testsuite/gcc.dg/guality/pr36728-2.c
+++ b/gcc/testsuite/gcc.dg/guality/pr36728-2.c
@@ -49,5 +49,6 @@ main ()
   int l = 0;
   asm ( : =r (l) : 0 (l));
   a = foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+  asm volatile ( :: r (l));
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr36728-3.c 
b/gcc/testsuite/gcc.dg/guality/pr36728-3.c
index bb2c067..4700d50 100644
--- a/gcc/testsuite/gcc.dg/guality/pr36728-3.c
+++ b/gcc/testsuite/gcc.dg/guality/pr36728-3.c
@@ -47,5 +47,6 @@ main ()
   int l = 0;
   asm volatile ( : =r (l) : 0 (l));
   foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+  asm volatile ( :: r (l));
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/guality/pr36728-4.c 
b/gcc/testsuite/gcc.dg/guality/pr36728-4.c
index fee79c4..bf6e9e9 100644
--- a/gcc/testsuite/gcc.dg/guality/pr36728-4.c
+++ b/gcc/testsuite/gcc.dg/guality/pr36728-4.c
@@ -47,5 +47,6 @@ main ()
   int l = 0;
   asm volatile ( : =r (l) : 0 (l));
   foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+  asm volatile ( :: r (l));
   return 0;
 }