public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6529] Add testcase for PR 83541.
@ 2022-01-12 15:28 Andrew Macleod
  0 siblings, 0 replies; only message in thread
From: Andrew Macleod @ 2022-01-12 15:28 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:75845d584f490c294d40908168e5721adc38145d

commit r12-6529-g75845d584f490c294d40908168e5721adc38145d
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Tue Jan 11 14:58:35 2022 -0500

    Add testcase for PR 83541.
    
    Ranger now performs this optimzation.
    
            PR tree-optimization/83541
            gcc/testsuite
            * g++.dg/pr83541.C: New.

Diff:
---
 gcc/testsuite/g++.dg/pr83541.C | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gcc/testsuite/g++.dg/pr83541.C b/gcc/testsuite/g++.dg/pr83541.C
new file mode 100644
index 00000000000..f5b181e064a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr83541.C
@@ -0,0 +1,17 @@
+// PR tree-optimization/83541
+// { dg-do compile }
+// { dg-options "-O3 -std=c++17 -ffast-math -fdump-tree-evrp"  }
+
+#include <limits>
+
+int test(int x)
+{
+    if(x == std::numeric_limits<int>::max())
+    {
+        return x+1;
+    }
+    return 42;
+}
+
+// { dg-final { scan-tree-dump "return 42"  evrp } }
+// { dg-final { scan-tree-dump-not "return _"  evrp } }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-12 15:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 15:28 [gcc r12-6529] Add testcase for PR 83541 Andrew Macleod

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).