public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: gcc-patches@gcc.gnu.org
Subject: [committed] testsuite: Add testcase for already fixed PR [PR99739]
Date: Fri, 24 Mar 2023 09:52:23 +0100	[thread overview]
Message-ID: <ZB1kx/ykFT0v62j+@tucnak> (raw)

Hi!

This PR was fixed by r13-1268-g8c99e307b20, I'm adding testcase
to make sure we don't regress on it in the future.

Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk as
obvious.

2023-03-24  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/99739
	* gcc.dg/tree-ssa/pr99739.c: New test.

--- gcc/testsuite/gcc.dg/tree-ssa/pr99739.c.jj	2023-03-23 19:08:39.528651948 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/pr99739.c	2023-03-23 19:08:31.158770968 +0100
@@ -0,0 +1,40 @@
+/* PR tree-optimization/99739 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-not "__builtin_abort \\\(\\\);" "optimized" } } */
+
+static inline int
+foo (int i, int j, int k)
+{
+  int x = 1;
+  if (i && j && k)
+    x = 2;
+  if (i && j && k)
+    return x;
+  return -1;
+}
+
+void
+bar (int i, int j, int k)
+{
+  if (foo (i, j, k) == 1)
+    __builtin_abort ();
+}
+
+static inline int
+baz (int i, int j, int k)
+{
+  int x = 1;
+  if (i && j && k)
+    x = 2;
+  if (i && k && j)
+    return x;
+  return -1;
+}
+
+void
+qux (int i, int j, int k)
+{
+  if (baz (i, j, k) == 1)
+    __builtin_abort ();
+}

	Jakub


                 reply	other threads:[~2023-03-24 11:01 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=ZB1kx/ykFT0v62j+@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@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).