This PR was fixed by one of the other patches, just adding the testcase.

Andrew
From c9a4bd0dca16ad4de299e9f0c4a2afef6b85b8f0 Mon Sep 17 00:00:00 2001
From: Andrew MacLeod <[email protected]>
Date: Fri, 24 Oct 2025 17:32:32 -0400
Subject: [PATCH 2/2] Add test case for PR 110405

PR was fixed bu one of the other patches.

	* gcc.dg/pr110405.c: New.
---
 gcc/testsuite/gcc.dg/pr110405.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/pr110405.c

diff --git a/gcc/testsuite/gcc.dg/pr110405.c b/gcc/testsuite/gcc.dg/pr110405.c
new file mode 100644
index 00000000000..549cc7bca2a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr110405.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+void foo (unsigned long);
+void
+f (unsigned long i)
+{
+  if ((i & 7) == 6)
+    if(i & 1)
+      foo (0);
+}
+
+/* { dg-final { scan-tree-dump-not "foo"  "optimized" } } */
+
-- 
2.45.0

Reply via email to