Hi!

These tests were broken by my r16-1398 PR120434 change and
fixed by r16-1482 PR120629 change.

Committing these to increase testsuite coverage.

2025-06-12  Jakub Jelinek  <ja...@redhat.com>

        PR middle-end/120630
        * gcc.dg/pr120630.c: New test.
        * gcc.c-torture/execute/pr120630.c: New test.

--- gcc/testsuite/gcc.dg/pr120630.c.jj  2025-06-12 16:48:18.302877196 +0200
+++ gcc/testsuite/gcc.dg/pr120630.c     2025-06-12 16:48:08.959000675 +0200
@@ -0,0 +1,25 @@
+/* PR middle-end/120630 */
+/* { dg-do run } */
+/* { dg-options "-O3 -fno-tree-loop-im -fno-tree-loop-optimize -fno-tree-ch" } 
*/
+
+int a, c, d;
+
+void
+foo (int b)
+{
+  a = b;
+}
+
+int
+main ()
+{
+  while (d)
+    ;
+  for (c = 0; c > -3; c--)
+    {
+      long f = c;
+      foo (f >> 2);
+    }
+  if (a != -1)
+    __builtin_abort ();
+}
--- gcc/testsuite/gcc.c-torture/execute/pr120630.c.jj   2025-06-12 
16:48:45.490517913 +0200
+++ gcc/testsuite/gcc.c-torture/execute/pr120630.c      2025-06-12 
16:50:55.226803454 +0200
@@ -0,0 +1,29 @@
+/* PR middle-end/120630 */
+
+__attribute__((noipa)) int
+foo (const char *x, ...)
+{
+  return *x;
+}
+
+int a, b, c;
+unsigned d = 1;
+
+int
+main ()
+{
+  if (a)
+    foo ("0");
+  int e = -1;
+  if (a < 1)
+    {
+      e = c;
+      if (c)
+       while (1)
+         ;
+    }
+  b = (~e + 0UL) / -1;
+  if (d > b)
+    __builtin_abort ();
+  return 0;
+}

        Jakub

Reply via email to