diff mbox

vector comparisons in C++

Message ID alpine.DEB.2.02.1209202154550.3726@laptop-mg.saclay.inria.fr
State New
Headers show

Commit Message

Marc Glisse Sept. 20, 2012, 8:01 p.m. UTC
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.

Comments

Richard Biener Sept. 21, 2012, 9:05 a.m. UTC | #1
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);
>
diff mbox

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