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 testcases for already fixed PR [PR100541]
Date: Wed, 2 Mar 2022 10:42:28 +0100	[thread overview]
Message-ID: <Yh88BET3oQX3Rpmt@tucnak> (raw)

Hi!

These testcases started failing with r12-630 and one of them
got fixed with r12-4531 (aka PR102764 fix and r12-4616 further
improved the fix) and the other went latent in r12-2591 (i.e. threader
changes) and I believe was fixed for real by the PR102764 fix too.

Regtested on x86_64-linux and i686-linux, committed to trunk as obvious.

2022-03-02  Jakub Jelinek  <jakub@redhat.com>

	PR debug/100541
	* g++.dg/opt/pr100541-1.C: New test.
	* g++.dg/opt/pr100541-2.C: New test.

--- gcc/testsuite/g++.dg/opt/pr100541-1.C.jj	2022-03-01 16:52:21.115876189 +0100
+++ gcc/testsuite/g++.dg/opt/pr100541-1.C	2022-03-01 16:51:35.760341725 +0100
@@ -0,0 +1,24 @@
+// PR debug/100541
+// { dg-do compile }
+// { dg-options "-O3 -fno-expensive-optimizations -fno-tree-dce -fno-tree-dominator-opts -fcompare-debug" }
+
+int a, b, i, x, y;
+
+int
+foo ()
+{
+  int rcmd = 0;
+  switch (x) {
+  case 0:
+    if (i)
+      rcmd = 6;
+    if (y % 3)
+      int &m1 = rcmd = rcmd | 5;
+    break;
+  case 1:
+    rcmd = b;
+  }
+  if (rcmd != 7)
+    return rcmd;
+  return a;
+}
--- gcc/testsuite/g++.dg/opt/pr100541-2.C.jj	2022-03-01 16:52:25.162819696 +0100
+++ gcc/testsuite/g++.dg/opt/pr100541-2.C	2022-03-01 16:53:05.497256709 +0100
@@ -0,0 +1,25 @@
+// PR debug/100541
+// { dg-do compile { target c++11 } }
+// { dg-options "-O2 -fno-tree-dce -fno-tree-dominator-opts -fcompare-debug" }
+
+int INVALID_TILE;
+void GetSlopePixelZ();
+long RUNWAY_IN_block;
+struct Airport {
+  long flags;
+};
+struct Station {
+  Airport airport;
+} * HandleCrashedAircraft_st;
+short HandleCrashedAircraft_v_0;
+void HandleCrashedAircraft() {
+  Station *__trans_tmp_1 = INVALID_TILE ? nullptr : HandleCrashedAircraft_st,
+          *st;
+  if (HandleCrashedAircraft_v_0 && __trans_tmp_1 == nullptr &&
+      HandleCrashedAircraft_v_0 % 3)
+    GetSlopePixelZ();
+  if (HandleCrashedAircraft_v_0)
+    GetSlopePixelZ();
+  if (__trans_tmp_1)
+    st->airport.flags &= RUNWAY_IN_block;
+}

	Jakub


                 reply	other threads:[~2022-03-02  9:42 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=Yh88BET3oQX3Rpmt@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).