public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-960] testsuite: Also test swapped arguments of __builtin_mul_overflow_p [PR30314]
@ 2022-06-02 9:17 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2022-06-02 9:17 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:72c605eea94065606b5ddcb5a51ef24a3d2841e9
commit r13-960-g72c605eea94065606b5ddcb5a51ef24a3d2841e9
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Jun 2 11:14:09 2022 +0200
testsuite: Also test swapped arguments of __builtin_mul_overflow_p [PR30314]
To test the commutativity of __builtin_mul_overflow* arguments in the
optimization, I've added 2 further tests.
2022-06-02 Jakub Jelinek <jakub@redhat.com>
PR middle-end/30314
* gcc.dg/tree-ssa/pr30314.c: Add tests with swapped arguments.
Diff:
---
gcc/testsuite/gcc.dg/tree-ssa/pr30314.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr30314.c b/gcc/testsuite/gcc.dg/tree-ssa/pr30314.c
index 91388afde22..99e4ee255fa 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr30314.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr30314.c
@@ -4,6 +4,8 @@
/* { dg-final { scan-tree-dump-not "\.MUL_OVERFLOW " "optimized" } } */
/* { dg-final { scan-tree-dump " > 122713351" "optimized" { target int32 } } } */
/* { dg-final { scan-tree-dump " > 527049830677415760" "optimized" { target lp64 } } } */
+/* { dg-final { scan-tree-dump " > 102261126" "optimized" { target int32 } } } */
+/* { dg-final { scan-tree-dump " > 439208192231179800" "optimized" { target lp64 } } } */
int
foo (unsigned int x)
@@ -16,3 +18,15 @@ bar (unsigned long int x)
{
return __builtin_mul_overflow_p (x, 35UL, 0UL);
}
+
+int
+baz (unsigned int x)
+{
+ return __builtin_mul_overflow_p (42, x, 0U);
+}
+
+int
+qux (unsigned long int x)
+{
+ return __builtin_mul_overflow_p (42, x, 0UL);
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-02 9:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02 9:17 [gcc r13-960] testsuite: Also test swapped arguments of __builtin_mul_overflow_p [PR30314] 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).