public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][testsuite]: Make bitint early vect test more accurate
@ 2024-01-10 16:55 Tamar Christina
  2024-01-10 17:04 ` Jakub Jelinek
  0 siblings, 1 reply; 5+ messages in thread
From: Tamar Christina @ 2024-01-10 16:55 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd, jakub

[-- Attachment #1: Type: text/plain, Size: 3299 bytes --]

Hi All,

This changes the tests I committed for PR113287 to also
run on targets that don't support bitint.

Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu
and no issues and tests run on both.

Ok for master?

Thanks,
Tamar

gcc/testsuite/ChangeLog:

	PR tree-optimization/113287
	* gcc.dg/vect/vect-early-break_100-pr113287.c: Support non-bitint.
	* gcc.dg/vect/vect-early-break_99-pr113287.c: Likewise.

--- inline copy of patch -- 
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
index f908e5bc60779c148dc95bda3e200383d12b9e1e..05fb84e1d36d4d05f39e48e41fc70703074ecabd 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
@@ -1,28 +1,29 @@
 /* { dg-add-options vect_early_break } */
 /* { dg-require-effective-target vect_early_break } */
-/* { dg-require-effective-target vect_int } */
-/* { dg-require-effective-target bitint } */
+/* { dg-require-effective-target vect_long_long } */
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
 
 __attribute__((noipa)) void
-bar (unsigned long *p)
+bar (unsigned long long *p)
 {
-  __builtin_memset (p, 0, 142 * sizeof (unsigned long));
-  p[17] = 0x50000000000UL;
+  __builtin_memset (p, 0, 142 * sizeof (unsigned long long));
+  p[17] = 0x50000000000ULL;
 }
 
 __attribute__((noipa)) int
 foo (void)
 {
-  unsigned long r[142];
+  unsigned long long r[142];
   bar (r);
-  unsigned long v = ((long) r[0] >> 31);
+  unsigned long long v = ((long) r[0] >> 31);
   if (v + 1 > 1)
     return 1;
-  for (unsigned long i = 1; i <= 140; ++i)
+  for (unsigned long long i = 1; i <= 140; ++i)
     if (r[i] != v)
       return 1;
-  unsigned long w = r[141];
-  if ((unsigned long) (((long) (w << 60)) >> 60) != v)
+  unsigned long long w = r[141];
+  if ((unsigned long long) (((long) (w << 60)) >> 60) != v)
     return 1;
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
index b92a8a268d803ab1656b4716b1a319ed4edc87a3..fb99ef39402ee7b3c6c564e7db5f5543a5f0c2e0 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
@@ -1,9 +1,18 @@
 /* { dg-add-options vect_early_break } */
 /* { dg-require-effective-target vect_early_break } */
-/* { dg-require-effective-target vect_int } */
-/* { dg-require-effective-target bitint } */
+/* { dg-require-effective-target vect_long_long } */
 
-_BitInt(998) b;
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
+
+#if __BITINT_MAXWIDTH__ >= 9020
+typedef _BitInt(9020) B9020;
+typedef _BitInt(998) B998;
+#else
+typedef long long B998;
+typedef long long B9020;
+#endif
+
+B998 b;
 char c;
 char d;
 char e;
@@ -14,7 +23,7 @@ char i;
 char j;
 
 void
-foo(char y, _BitInt(9020) a, char *r)
+foo(char y, B9020 a, char *r)
 {
   char x = __builtin_mul_overflow_p(a << sizeof(a), y, 0);
   x += c + d + e + f + g + h + i + j + b;
@@ -26,7 +35,12 @@ main(void)
 {
   char x;
   foo(5, 5, &x);
+#if __BITINT_MAXWIDTH__ >= 9020
   if (x != 1)
     __builtin_abort();
+#else
+  if (x != 0)
+    __builtin_abort();
+#endif
   return 0;
 }




-- 

[-- Attachment #2: rb18146.patch --]
[-- Type: text/plain, Size: 2850 bytes --]

diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
index f908e5bc60779c148dc95bda3e200383d12b9e1e..05fb84e1d36d4d05f39e48e41fc70703074ecabd 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
@@ -1,28 +1,29 @@
 /* { dg-add-options vect_early_break } */
 /* { dg-require-effective-target vect_early_break } */
-/* { dg-require-effective-target vect_int } */
-/* { dg-require-effective-target bitint } */
+/* { dg-require-effective-target vect_long_long } */
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
 
 __attribute__((noipa)) void
-bar (unsigned long *p)
+bar (unsigned long long *p)
 {
-  __builtin_memset (p, 0, 142 * sizeof (unsigned long));
-  p[17] = 0x50000000000UL;
+  __builtin_memset (p, 0, 142 * sizeof (unsigned long long));
+  p[17] = 0x50000000000ULL;
 }
 
 __attribute__((noipa)) int
 foo (void)
 {
-  unsigned long r[142];
+  unsigned long long r[142];
   bar (r);
-  unsigned long v = ((long) r[0] >> 31);
+  unsigned long long v = ((long) r[0] >> 31);
   if (v + 1 > 1)
     return 1;
-  for (unsigned long i = 1; i <= 140; ++i)
+  for (unsigned long long i = 1; i <= 140; ++i)
     if (r[i] != v)
       return 1;
-  unsigned long w = r[141];
-  if ((unsigned long) (((long) (w << 60)) >> 60) != v)
+  unsigned long long w = r[141];
+  if ((unsigned long long) (((long) (w << 60)) >> 60) != v)
     return 1;
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
index b92a8a268d803ab1656b4716b1a319ed4edc87a3..fb99ef39402ee7b3c6c564e7db5f5543a5f0c2e0 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
@@ -1,9 +1,18 @@
 /* { dg-add-options vect_early_break } */
 /* { dg-require-effective-target vect_early_break } */
-/* { dg-require-effective-target vect_int } */
-/* { dg-require-effective-target bitint } */
+/* { dg-require-effective-target vect_long_long } */
 
-_BitInt(998) b;
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
+
+#if __BITINT_MAXWIDTH__ >= 9020
+typedef _BitInt(9020) B9020;
+typedef _BitInt(998) B998;
+#else
+typedef long long B998;
+typedef long long B9020;
+#endif
+
+B998 b;
 char c;
 char d;
 char e;
@@ -14,7 +23,7 @@ char i;
 char j;
 
 void
-foo(char y, _BitInt(9020) a, char *r)
+foo(char y, B9020 a, char *r)
 {
   char x = __builtin_mul_overflow_p(a << sizeof(a), y, 0);
   x += c + d + e + f + g + h + i + j + b;
@@ -26,7 +35,12 @@ main(void)
 {
   char x;
   foo(5, 5, &x);
+#if __BITINT_MAXWIDTH__ >= 9020
   if (x != 1)
     __builtin_abort();
+#else
+  if (x != 0)
+    __builtin_abort();
+#endif
   return 0;
 }




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][testsuite]: Make bitint early vect test more accurate
  2024-01-10 16:55 [PATCH][testsuite]: Make bitint early vect test more accurate Tamar Christina
@ 2024-01-10 17:04 ` Jakub Jelinek
  2024-01-10 18:07   ` Tamar Christina
  0 siblings, 1 reply; 5+ messages in thread
From: Jakub Jelinek @ 2024-01-10 17:04 UTC (permalink / raw)
  To: Tamar Christina; +Cc: gcc-patches, nd

On Wed, Jan 10, 2024 at 04:55:00PM +0000, Tamar Christina wrote:
> 	PR tree-optimization/113287
> 	* gcc.dg/vect/vect-early-break_100-pr113287.c: Support non-bitint.

This part is ok.

> --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
> +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
> @@ -1,9 +1,18 @@
>  /* { dg-add-options vect_early_break } */
>  /* { dg-require-effective-target vect_early_break } */
> -/* { dg-require-effective-target vect_int } */
> -/* { dg-require-effective-target bitint } */
> +/* { dg-require-effective-target vect_long_long } */
>  
> -_BitInt(998) b;
> +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
> +
> +#if __BITINT_MAXWIDTH__ >= 9020
> +typedef _BitInt(9020) B9020;
> +typedef _BitInt(998) B998;
> +#else
> +typedef long long B998;
> +typedef long long B9020;
> +#endif
> +
> +B998 b;
>  char c;
>  char d;
>  char e;
> @@ -14,7 +23,7 @@ char i;
>  char j;
>  
>  void
> -foo(char y, _BitInt(9020) a, char *r)
> +foo(char y, B9020 a, char *r)
>  {
>    char x = __builtin_mul_overflow_p(a << sizeof(a), y, 0);

But I'm afraid I have no idea how is this supposed to work on
non-bitint targets or where __BITINT_MAXWIDTH__ is smaller than 9020.
There is no loop at all there, so what should be vectorized?

I'd say introduce 
# Return 1 if the target supports _BitInt(65535), 0 otherwise.

proc check_effective_target_bitint65535 { } {
    return [check_no_compiler_messages bitint65535 object {
        _BitInt (2) a = 1wb;
        unsigned _BitInt (65535) b = 0uwb;
    } "-std=c23"]
}

after bitint575 effective target and use it in the test.

	Jakub


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH][testsuite]: Make bitint early vect test more accurate
  2024-01-10 17:04 ` Jakub Jelinek
@ 2024-01-10 18:07   ` Tamar Christina
  2024-01-10 18:33     ` Jakub Jelinek
  2024-01-13  9:50     ` Jakub Jelinek
  0 siblings, 2 replies; 5+ messages in thread
From: Tamar Christina @ 2024-01-10 18:07 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches, nd

[-- Attachment #1: Type: text/plain, Size: 4981 bytes --]

> But I'm afraid I have no idea how is this supposed to work on
> non-bitint targets or where __BITINT_MAXWIDTH__ is smaller than 9020.
> There is no loop at all there, so what should be vectorized?
> 

Yeah It was giving an unresolved and I didn't notice in diff.

> I'd say introduce
> # Return 1 if the target supports _BitInt(65535), 0 otherwise.
> 
> proc check_effective_target_bitint65535 { } {
>     return [check_no_compiler_messages bitint65535 object {
>         _BitInt (2) a = 1wb;
>         unsigned _BitInt (65535) b = 0uwb;
>     } "-std=c23"]
> }
> 
> after bitint575 effective target and use it in the test.
>

Sure, how's:

--

This changes the tests I committed for PR113287 to also
run on targets that don't support bitint.

Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu and no issues and
tests run on both.

Ok for master?

Thanks,
Tamar

gcc/ChangeLog:

	* doc/sourcebuild.texi (check_effective_target_bitint65535): New.

gcc/testsuite/ChangeLog:

	PR tree-optimization/113287
	* gcc.dg/vect/vect-early-break_100-pr113287.c: Support non-bitint.
	* gcc.dg/vect/vect-early-break_99-pr113287.c: Likewise.
	* lib/target-supports.exp (bitint, bitint128, bitint575, bitint65535):
	Document them.

---inline copy of patch ---

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index bd62b21f3b725936eae34c22159ccbc9db40873f..6fbb102f9971d54d66d77dcee8f10a1b57aa6e5a 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -2864,6 +2864,18 @@ Target supports Graphite optimizations.
 @item fixed_point
 Target supports fixed-point extension to C.
 
+@item bitint
+Target supports _BitInt(N).
+
+@item bitint128
+Target supports _BitInt(128).
+
+@item bitint575
+Target supports _BitInt(575).
+
+@item bitint65535
+Target supports _BitInt(65535).
+
 @item fopenacc
 Target supports OpenACC via @option{-fopenacc}.
 
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
index f908e5bc60779c148dc95bda3e200383d12b9e1e..05fb84e1d36d4d05f39e48e41fc70703074ecabd 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
@@ -1,28 +1,29 @@
 /* { dg-add-options vect_early_break } */
 /* { dg-require-effective-target vect_early_break } */
-/* { dg-require-effective-target vect_int } */
-/* { dg-require-effective-target bitint } */
+/* { dg-require-effective-target vect_long_long } */
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
 
 __attribute__((noipa)) void
-bar (unsigned long *p)
+bar (unsigned long long *p)
 {
-  __builtin_memset (p, 0, 142 * sizeof (unsigned long));
-  p[17] = 0x50000000000UL;
+  __builtin_memset (p, 0, 142 * sizeof (unsigned long long));
+  p[17] = 0x50000000000ULL;
 }
 
 __attribute__((noipa)) int
 foo (void)
 {
-  unsigned long r[142];
+  unsigned long long r[142];
   bar (r);
-  unsigned long v = ((long) r[0] >> 31);
+  unsigned long long v = ((long) r[0] >> 31);
   if (v + 1 > 1)
     return 1;
-  for (unsigned long i = 1; i <= 140; ++i)
+  for (unsigned long long i = 1; i <= 140; ++i)
     if (r[i] != v)
       return 1;
-  unsigned long w = r[141];
-  if ((unsigned long) (((long) (w << 60)) >> 60) != v)
+  unsigned long long w = r[141];
+  if ((unsigned long long) (((long) (w << 60)) >> 60) != v)
     return 1;
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
index b92a8a268d803ab1656b4716b1a319ed4edc87a3..e141e8a9277f89527e8aff809fe101fdd91a4c46 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
@@ -1,7 +1,8 @@
 /* { dg-add-options vect_early_break } */
 /* { dg-require-effective-target vect_early_break } */
-/* { dg-require-effective-target vect_int } */
-/* { dg-require-effective-target bitint } */
+/* { dg-require-effective-target bitint65535 } */
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
 
 _BitInt(998) b;
 char c;
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index a9c76e0b290b19fd07574805bb2b87c86a5e9cf7..1ddcb3926a8d549b6a17b61e29e1d9836ecce897 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -3850,6 +3850,15 @@ proc check_effective_target_bitint575 { } {
     } "-std=c23"]
 }
 
+# Return 1 if the target supports _BitInt(65535), 0 otherwise.
+
+proc check_effective_target_bitint65535 { } {
+    return [check_no_compiler_messages bitint65535 object {
+        _BitInt (2) a = 1wb;
+        unsigned _BitInt (65535) b = 0uwb;
+    } "-std=c23"]
+}
+
 # Return 1 if the target supports compiling decimal floating point,
 # 0 otherwise.


[-- Attachment #2: rb18146.patch --]
[-- Type: application/octet-stream, Size: 3577 bytes --]

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index bd62b21f3b725936eae34c22159ccbc9db40873f..6fbb102f9971d54d66d77dcee8f10a1b57aa6e5a 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -2864,6 +2864,18 @@ Target supports Graphite optimizations.
 @item fixed_point
 Target supports fixed-point extension to C.
 
+@item bitint
+Target supports _BitInt(N).
+
+@item bitint128
+Target supports _BitInt(128).
+
+@item bitint575
+Target supports _BitInt(575).
+
+@item bitint65535
+Target supports _BitInt(65535).
+
 @item fopenacc
 Target supports OpenACC via @option{-fopenacc}.
 
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
index f908e5bc60779c148dc95bda3e200383d12b9e1e..05fb84e1d36d4d05f39e48e41fc70703074ecabd 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
@@ -1,28 +1,29 @@
 /* { dg-add-options vect_early_break } */
 /* { dg-require-effective-target vect_early_break } */
-/* { dg-require-effective-target vect_int } */
-/* { dg-require-effective-target bitint } */
+/* { dg-require-effective-target vect_long_long } */
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
 
 __attribute__((noipa)) void
-bar (unsigned long *p)
+bar (unsigned long long *p)
 {
-  __builtin_memset (p, 0, 142 * sizeof (unsigned long));
-  p[17] = 0x50000000000UL;
+  __builtin_memset (p, 0, 142 * sizeof (unsigned long long));
+  p[17] = 0x50000000000ULL;
 }
 
 __attribute__((noipa)) int
 foo (void)
 {
-  unsigned long r[142];
+  unsigned long long r[142];
   bar (r);
-  unsigned long v = ((long) r[0] >> 31);
+  unsigned long long v = ((long) r[0] >> 31);
   if (v + 1 > 1)
     return 1;
-  for (unsigned long i = 1; i <= 140; ++i)
+  for (unsigned long long i = 1; i <= 140; ++i)
     if (r[i] != v)
       return 1;
-  unsigned long w = r[141];
-  if ((unsigned long) (((long) (w << 60)) >> 60) != v)
+  unsigned long long w = r[141];
+  if ((unsigned long long) (((long) (w << 60)) >> 60) != v)
     return 1;
   return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
index b92a8a268d803ab1656b4716b1a319ed4edc87a3..e141e8a9277f89527e8aff809fe101fdd91a4c46 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
@@ -1,7 +1,8 @@
 /* { dg-add-options vect_early_break } */
 /* { dg-require-effective-target vect_early_break } */
-/* { dg-require-effective-target vect_int } */
-/* { dg-require-effective-target bitint } */
+/* { dg-require-effective-target bitint65535 } */
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
 
 _BitInt(998) b;
 char c;
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index a9c76e0b290b19fd07574805bb2b87c86a5e9cf7..1ddcb3926a8d549b6a17b61e29e1d9836ecce897 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -3850,6 +3850,15 @@ proc check_effective_target_bitint575 { } {
     } "-std=c23"]
 }
 
+# Return 1 if the target supports _BitInt(65535), 0 otherwise.
+
+proc check_effective_target_bitint65535 { } {
+    return [check_no_compiler_messages bitint65535 object {
+        _BitInt (2) a = 1wb;
+        unsigned _BitInt (65535) b = 0uwb;
+    } "-std=c23"]
+}
+
 # Return 1 if the target supports compiling decimal floating point,
 # 0 otherwise.
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][testsuite]: Make bitint early vect test more accurate
  2024-01-10 18:07   ` Tamar Christina
@ 2024-01-10 18:33     ` Jakub Jelinek
  2024-01-13  9:50     ` Jakub Jelinek
  1 sibling, 0 replies; 5+ messages in thread
From: Jakub Jelinek @ 2024-01-10 18:33 UTC (permalink / raw)
  To: Tamar Christina; +Cc: gcc-patches, nd

On Wed, Jan 10, 2024 at 06:07:16PM +0000, Tamar Christina wrote:
> This changes the tests I committed for PR113287 to also
> run on targets that don't support bitint.
> 
> Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu and no issues and
> tests run on both.
> 
> Ok for master?

Yes, thanks.

> gcc/ChangeLog:
> 
> 	* doc/sourcebuild.texi (check_effective_target_bitint65535): New.
> 
> gcc/testsuite/ChangeLog:
> 
> 	PR tree-optimization/113287
> 	* gcc.dg/vect/vect-early-break_100-pr113287.c: Support non-bitint.
> 	* gcc.dg/vect/vect-early-break_99-pr113287.c: Likewise.
> 	* lib/target-supports.exp (bitint, bitint128, bitint575, bitint65535):
> 	Document them.

	Jakub


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][testsuite]: Make bitint early vect test more accurate
  2024-01-10 18:07   ` Tamar Christina
  2024-01-10 18:33     ` Jakub Jelinek
@ 2024-01-13  9:50     ` Jakub Jelinek
  1 sibling, 0 replies; 5+ messages in thread
From: Jakub Jelinek @ 2024-01-13  9:50 UTC (permalink / raw)
  To: Tamar Christina; +Cc: gcc-patches, nd

On Wed, Jan 10, 2024 at 06:07:16PM +0000, Tamar Christina wrote:
> --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
> +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c

When the testcase was being adjusted for unsigned long -> unsigned long long,
two spots using long weren't changed to long long, so the testcase still warns
about UB in shifts.

Excess errors:
.../gcc/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c:28:48: warning: right shift count >= width of type [-Wshift-count-overflow]

Fixed thusly, committed to trunk as obvious.

2024-01-13  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/113287
	* gcc.dg/vect/vect-early-break_100-pr113287.c: Use long long instead
	of long.

--- gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c.jj	2024-01-12 17:02:46.176055981 +0100
+++ gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c	2024-01-13 10:30:25.452872016 +0100
@@ -18,14 +18,14 @@ foo (void)
 {
   unsigned long long r[142];
   bar (r);
-  unsigned long long v = ((long) r[0] >> 31);
+  unsigned long long v = ((long long) r[0] >> 31);
   if (v + 1 > 1)
     return 1;
   for (unsigned long long i = 1; i <= 140; ++i)
     if (r[i] != v)
       return 1;
   unsigned long long w = r[141];
-  if ((unsigned long long) (((long) (w << 60)) >> 60) != v)
+  if ((unsigned long long) (((long long) (w << 60)) >> 60) != v)
     return 1;
   return 0;
 }



	Jakub


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-13  9:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-10 16:55 [PATCH][testsuite]: Make bitint early vect test more accurate Tamar Christina
2024-01-10 17:04 ` Jakub Jelinek
2024-01-10 18:07   ` Tamar Christina
2024-01-10 18:33     ` Jakub Jelinek
2024-01-13  9:50     ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).