public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andrew Macleod <amacleod@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-6529] Add testcase for PR 83541.
Date: Wed, 12 Jan 2022 15:28:50 +0000 (GMT)	[thread overview]
Message-ID: <20220112152850.30BF9394082A@sourceware.org> (raw)

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 } }


                 reply	other threads:[~2022-01-12 15:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220112152850.30BF9394082A@sourceware.org \
    --to=amacleod@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).