Hi!

This test was miscompiled due to stale REG_UNUSED vs. single_set,
fixed with r16-6062-ge1b8d097297.

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

2026-01-08  Jakub Jelinek  <[email protected]>

        PR rtl-optimization/121675
        * gcc.dg/pr121675.c: New test.

--- gcc/testsuite/gcc.dg/pr121675.c.jj  2026-01-07 17:30:48.166972609 +0100
+++ gcc/testsuite/gcc.dg/pr121675.c     2026-01-07 17:29:19.282474290 +0100
@@ -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;
+}

        Jakub

Reply via email to