This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: vector comparisons in C++
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Marc Glisse <marc dot glisse at inria dot fr>
- Cc: gcc-patches at gcc dot gnu dot org, jason at redhat dot com
- Date: Fri, 21 Sep 2012 11:05:19 +0200
- Subject: Re: vector comparisons in C++
- References: <alpine.DEB.2.02.1208312352110.11410@stedding.saclay.inria.fr> <alpine.DEB.2.02.1209202154550.3726@laptop-mg.saclay.inria.fr>
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);
>