https://gcc.gnu.org/g:07da32d7e64673771ce121caf8dce24db510d8ff

commit r16-6571-g07da32d7e64673771ce121caf8dce24db510d8ff
Author: Jakub Jelinek <[email protected]>
Date:   Thu Jan 8 09:47:38 2026 +0100

    testsuite: Add testcase for already fixed test [PR121675]
    
    This test was miscompiled due to stale REG_UNUSED vs. single_set,
    fixed with r16-6062-ge1b8d097297.
    
    2026-01-08  Jakub Jelinek  <[email protected]>
    
            PR rtl-optimization/121675
            * gcc.dg/pr121675.c: New test.

Diff:
---
 gcc/testsuite/gcc.dg/pr121675.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/pr121675.c b/gcc/testsuite/gcc.dg/pr121675.c
new file mode 100644
index 000000000000..96b6bd962268
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr121675.c
@@ -0,0 +1,32 @@
+/* PR rtl-optimization/121675 */
+/* { dg-do run { target int32plus } } */
+/* { dg-options "-O3" } */
+
+int a, c, d, e;
+
+int
+foo (volatile int f, int g)
+{
+  f = -2;
+  if (!f)
+    a = 1;
+  c = 11 / f - g + 2;
+  g = c + 2;
+  if (!(1 / c + (g - 1)))
+    a = 1;
+  return a + f;
+}
+
+int
+main ()
+{
+  do
+    {
+      e = (foo (1, -1) - 30885397) % 2 - 3;
+      d = foo (1, -1) - 1430885400;
+    }
+  while (a + 1 == 0);
+  if (d + e != -1430885406)
+    __builtin_abort ();
+  return 0;
+}

Reply via email to