Patchwork vector comparisons in C++

login
register
mail settings
Submitter Marc Glisse
Date Sept. 20, 2012, 8:01 p.m.
Message ID <alpine.DEB.2.02.1209202154550.3726@laptop-mg.saclay.inria.fr>
Download mbox | patch
Permalink /patch/185468/
State New
Headers show

Comments

Marc Glisse - Sept. 20, 2012, 8:01 p.m.
On Sat, 1 Sep 2012, Marc Glisse wrote:

> I have some issues with the vector-compare-2.c torture test. It passes a 
> vector by value (argument and return type), which is likely to warn (although 
> for some reason it doesn't for me, with today's compiler). And it takes 
> -Wno-psabi through a .x file, but those are not read in c-c++-common, so I 
> put it in dg-options. I would have changed the function to use pointers, but 
> I don't know if it specifically wants to test passing by value...

Hello,

Pat Haugen just explained it to me: there was a default -w option in the 
old location of the testcase. However, there isn't in the new one. I am 
thus proposing the following, which restores the old behavior. Note that 
-Wno-psabi is still needed as it is not implied by -w.

2012-09-20  Marc Glisse  <marc.glisse@inria.fr>

 	PR c++/54427
 	* c-c++-common/torture/vector-compare-2.c: Add -w.
Richard Guenther - Sept. 21, 2012, 9:05 a.m.
On Thu, Sep 20, 2012 at 10:01 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> On Sat, 1 Sep 2012, Marc Glisse wrote:
>
>> I have some issues with the vector-compare-2.c torture test. It passes a
>> vector by value (argument and return type), which is likely to warn
>> (although for some reason it doesn't for me, with today's compiler). And it
>> takes -Wno-psabi through a .x file, but those are not read in c-c++-common,
>> so I put it in dg-options. I would have changed the function to use
>> pointers, but I don't know if it specifically wants to test passing by
>> value...
>
>
> Hello,
>
> Pat Haugen just explained it to me: there was a default -w option in the old
> location of the testcase. However, there isn't in the new one. I am thus
> proposing the following, which restores the old behavior. Note that
> -Wno-psabi is still needed as it is not implied by -w.

Ok.

Thanks,
Richard.

> 2012-09-20  Marc Glisse  <marc.glisse@inria.fr>
>
>         PR c++/54427
>         * c-c++-common/torture/vector-compare-2.c: Add -w.
>
> --
> Marc Glisse
> Index: c-c++-common/torture/vector-compare-2.c
> ===================================================================
> --- c-c++-common/torture/vector-compare-2.c     (revision 191585)
> +++ c-c++-common/torture/vector-compare-2.c     (working copy)
> @@ -1,12 +1,12 @@
>  /* { dg-do run } */
> -/* { dg-options "-Wno-psabi" } */
> +/* { dg-options "-Wno-psabi -w" } */
>  #define vector(elcount, type)  \
>  __attribute__((vector_size((elcount)*sizeof(type)))) type
>
>  /* Check that constant folding in
>     these simple cases works.  */
>  vector (4, int)
>  foo (vector (4, int) x)
>  {
>    return   (x == x) + (x != x) + (x >  x)
>          + (x <  x) + (x >= x) + (x <= x);
>

Patch

Index: c-c++-common/torture/vector-compare-2.c

===================================================================
--- c-c++-common/torture/vector-compare-2.c	(revision 191585)

+++ c-c++-common/torture/vector-compare-2.c	(working copy)

@@ -1,12 +1,12 @@ 

 /* { dg-do run } */
-/* { dg-options "-Wno-psabi" } */

+/* { dg-options "-Wno-psabi -w" } */

 #define vector(elcount, type)  \
 __attribute__((vector_size((elcount)*sizeof(type)))) type
 
 /* Check that constant folding in 
    these simple cases works.  */
 vector (4, int)
 foo (vector (4, int) x)
 {
   return   (x == x) + (x != x) + (x >  x) 
 	 + (x <  x) + (x >= x) + (x <= x);