diff mbox

[testsuite] Fix gcc.dg/vect/pr59354.c

Message ID 54EFAD76.7040409@linux.vnet.ibm.com
State New
Headers show

Commit Message

Pat Haugen Feb. 26, 2015, 11:34 p.m. UTC
The subject testcase is failing on older powerpc64 hardware that doesn't 
support vector instructions because the prolog code is saving callee 
save vector registers used in the loop before the check_vect() call has 
even been performed. Following was tested on powerpc64-linux. Ok for 
trunk/4.9 branch?

-Pat


2015-02-26  Pat Haugen <pthaugen@us.ibm.com>

gcc/testsuite:
         * gcc.dg/vect/pr59354.c: Move vector producing code to separate 
function.

Comments

Richard Biener Feb. 27, 2015, 8:08 a.m. UTC | #1
On Fri, Feb 27, 2015 at 12:34 AM, Pat Haugen
<pthaugen@linux.vnet.ibm.com> wrote:
> The subject testcase is failing on older powerpc64 hardware that doesn't
> support vector instructions because the prolog code is saving callee save
> vector registers used in the loop before the check_vect() call has even been
> performed. Following was tested on powerpc64-linux. Ok for trunk/4.9 branch?

Hum.  So the whole check_vect business is unreliable on ppc64?  I'd rather
make sure to not run the tests at all on older ppc hardware then?

Well.  Ok.

Thanks,
Richard.

> -Pat
>
>
> 2015-02-26  Pat Haugen <pthaugen@us.ibm.com>
>
> gcc/testsuite:
>         * gcc.dg/vect/pr59354.c: Move vector producing code to separate
> function.
>
>
> Index: gcc.dg/vect/pr59354.c
> ===================================================================
> --- gcc.dg/vect/pr59354.c    (revision 221016)
> +++ gcc.dg/vect/pr59354.c    (working copy)
> @@ -8,12 +8,11 @@ void abort (void);
>  unsigned int a[256];
>  unsigned char b[256];
>
> -int main()
> +__attribute__ ((noinline)) void
> +main1()
>  {
>    int i, z, x, y;
>
> -  check_vect ();
> -
>    for(i = 0; i < 256; i++)
>      {
>        a[i] = i % 5;
> @@ -27,6 +26,13 @@ int main()
>
>    if (b[4] != 1)
>      abort ();
> +}
> +
> +int main (void)
> +{
> +  check_vect ();
> +
> +  main1 ();
>
>    return 0;
>  }
>
Jakub Jelinek Feb. 27, 2015, 8:18 a.m. UTC | #2
On Fri, Feb 27, 2015 at 09:08:30AM +0100, Richard Biener wrote:
> On Fri, Feb 27, 2015 at 12:34 AM, Pat Haugen
> <pthaugen@linux.vnet.ibm.com> wrote:
> > The subject testcase is failing on older powerpc64 hardware that doesn't
> > support vector instructions because the prolog code is saving callee save
> > vector registers used in the loop before the check_vect() call has even been
> > performed. Following was tested on powerpc64-linux. Ok for trunk/4.9 branch?
> 
> Hum.  So the whole check_vect business is unreliable on ppc64?  I'd rather
> make sure to not run the tests at all on older ppc hardware then?
> 
> Well.  Ok.

I think the separate main containing just check_vect and call to a noinline
function is very much desirable, otherwise it works purely by accident if it
works at all, IMHO on all arches.

	Jakub
diff mbox

Patch

Index: gcc.dg/vect/pr59354.c
===================================================================
--- gcc.dg/vect/pr59354.c    (revision 221016)
+++ gcc.dg/vect/pr59354.c    (working copy)
@@ -8,12 +8,11 @@  void abort (void);
  unsigned int a[256];
  unsigned char b[256];

-int main()
+__attribute__ ((noinline)) void
+main1()
  {
    int i, z, x, y;

-  check_vect ();
-
    for(i = 0; i < 256; i++)
      {
        a[i] = i % 5;
@@ -27,6 +26,13 @@  int main()

    if (b[4] != 1)
      abort ();
+}
+
+int main (void)
+{
+  check_vect ();
+
+  main1 ();

    return 0;
  }