diff mbox series

[committed] testsuite: Fix up sse3-addsubps.c

Message ID ZrcrdSpQKQdJ+bQF@tucnak
State New
Headers show
Series [committed] testsuite: Fix up sse3-addsubps.c | expand

Commit Message

Jakub Jelinek Aug. 10, 2024, 8:57 a.m. UTC
On Thu, Aug 08, 2024 at 10:01:14PM +0200, Alejandro Colomar wrote:
> Here are the suspects:
> 
> ./gcc/testsuite/gcc.target/powerpc/sse3-addsubps.c:80:
> 	  for (i = 0; i < sizeof (vals) / sizeof (vals); i += 8)

This is an obvious typo as can be seen in what the test does, what similar
tests committed in the same commit do (all the others use sizeof (vals) /
sizeof (vals[0])) and what the test originates from (i386/sse3-addsubps.c
uses there constant 80, which is that sizeof (vals) / sizeof (vals[0])).

Tested on powerpc64-linux (where the test is UNSUPPORTED) and
powerpc64le-linux, where the test passes before (in that case it tests just
one vector rather than all 10) and after the change.

Committed to trunk as obvious.

2024-08-10  Jakub Jelinek  <jakub@redhat.com>

	* gcc.target/powerpc/sse3-addsubps.c (TEST): Divide by
	sizeof (vals[0]) rather than sizeof (vals).


	Jakub

Comments

Alejandro Colomar Aug. 12, 2024, 11:43 p.m. UTC | #1
Hi Jakub,

On Sat, Aug 10, 2024 at 10:57:25AM GMT, Jakub Jelinek wrote:
> This is an obvious typo as can be seen in what the test does, what similar
> tests committed in the same commit do (all the others use sizeof (vals) /
> sizeof (vals[0])) and what the test originates from (i386/sse3-addsubps.c
> uses there constant 80, which is that sizeof (vals) / sizeof (vals[0])).
> 
> Tested on powerpc64-linux (where the test is UNSUPPORTED) and
> powerpc64le-linux, where the test passes before (in that case it tests just
> one vector rather than all 10) and after the change.
> 
> Committed to trunk as obvious.
> 
> 2024-08-10  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* gcc.target/powerpc/sse3-addsubps.c (TEST): Divide by
> 	sizeof (vals[0]) rather than sizeof (vals).
> 
> --- gcc/testsuite/gcc.target/powerpc/sse3-addsubps.c.jj3	2024-03-18 11:02:16.152884555 +0000
> +++ gcc/testsuite/gcc.target/powerpc/sse3-addsubps.c	2024-08-10 08:46:57.259430503 +0000
> @@ -77,7 +77,7 @@ TEST (void)
>    int i;
>    int fail = 0;
>  
> -  for (i = 0; i < sizeof (vals) / sizeof (vals); i += 8)
> +  for (i = 0; i < sizeof (vals) / sizeof (vals[0]); i += 8)
>      {
>        p1[0] = vals[i+0];
>        p1[1] = vals[i+1];

Thanks for this, and also for

	commit 723e0f724e0c884a31ddf4a688604e7163ed31f2
	Author: Jakub Jelinek <jakub@redhat.com>
	Date:   Fri Aug 9 09:34:50 2024 +0200

	    c-family: Add some more ARRAY_SIZE uses
	    
	    These two spots were just non-standard, because they divided
	    sizeof (omp_pragmas_simd) by sizeof (*omp_pragmas) and not
	    the expected sizeof (*omp_pragmas_simd) and so weren't converted
	    into ARRAY_SIZE.  Both of the latter sizes are the same though,
	    as both arrays have the same type, so this patch doesn't change
	    anything but readability.
	    
	    2024-08-09  Jakub Jelinek  <jakub@redhat.com>
	    
		    * c-pragma.cc (c_pp_lookup_pragma): Use ARRAY_SIZE in
		    n_omp_pragmas_simd initializer.
		    (init_pragmas): Likewise.


(It would be nice if the commit messages would have included something
 like Reported-by or an equivalent.)  :)

Have a lovely night!
Alex
diff mbox series

Patch

--- gcc/testsuite/gcc.target/powerpc/sse3-addsubps.c.jj3	2024-03-18 11:02:16.152884555 +0000
+++ gcc/testsuite/gcc.target/powerpc/sse3-addsubps.c	2024-08-10 08:46:57.259430503 +0000
@@ -77,7 +77,7 @@  TEST (void)
   int i;
   int fail = 0;
 
-  for (i = 0; i < sizeof (vals) / sizeof (vals); i += 8)
+  for (i = 0; i < sizeof (vals) / sizeof (vals[0]); i += 8)
     {
       p1[0] = vals[i+0];
       p1[1] = vals[i+1];