]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: add regression test for analyzer ICE [PR111099]
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 12 Feb 2026 01:49:44 +0000 (20:49 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Thu, 12 Feb 2026 01:49:44 +0000 (20:49 -0500)
The ICE in PR analyzer/111099 seems to have been fixed on trunk by
r16-6063-g0b786d961d4426.  Add a regression test for it.

gcc/testsuite/ChangeLog:
PR analyzer/111099
* gcc.dg/analyzer/torture/ice-pr111099.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/testsuite/gcc.dg/analyzer/torture/ice-pr111099.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/ice-pr111099.c b/gcc/testsuite/gcc.dg/analyzer/torture/ice-pr111099.c
new file mode 100644 (file)
index 0000000..89e07e5
--- /dev/null
@@ -0,0 +1,17 @@
+int
+get_count_bits_in_reg(int bit_start, int bit_count, int i_reg)
+{
+  int ret_count = 0;
+  int num_reg = 0;
+  int last_used_bit = (bit_start + bit_count - 1);
+  for (int num_bit = bit_start; num_bit <= last_used_bit; ++num_bit) {
+    ++ret_count;
+    if ((((num_bit + 1) % 32) == 0) || (num_bit == last_used_bit)) {
+      if (i_reg == num_reg++) {
+       return ret_count;
+      }
+      ret_count = 0;
+    }
+  }
+  return 0;
+}