]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ipa: Initialize/release global obstack in process_new_functions [PR116068]
authorJakub Jelinek <jakub@redhat.com>
Wed, 15 Jan 2025 08:43:32 +0000 (09:43 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 15 Jan 2025 08:43:32 +0000 (09:43 +0100)
Other spots in cgraphunit.cc already call bitmap_obstack_initialize (NULL);
before running a pass list and bitmap_obstack_release (NULL); after that,
while process_new_functions wasn't doing that and with the new r15-130
bitmap_alloc checking that results in ICE.

2025-01-15  Jakub Jelinek  <jakub@redhat.com>

PR ipa/116068
* cgraphunit.cc (symbol_table::process_new_functions): Call
bitmap_obstack_initialize (NULL); and bitmap_obstack_release (NULL)
around processing the functions.

* gcc.dg/graphite/pr116068.c: New test.

gcc/cgraphunit.cc
gcc/testsuite/gcc.dg/graphite/pr116068.c [new file with mode: 0644]

index 284a22bb808fe162ccfb1b8cf5adde5d13878ce0..82f205488e904c4f81a5210b3f65b4c3bdc89642 100644 (file)
@@ -311,6 +311,7 @@ symbol_table::process_new_functions (void)
     {
       cgraph_node *node = cgraph_new_nodes[i];
       fndecl = node->decl;
+      bitmap_obstack_initialize (NULL);
       switch (state)
        {
        case CONSTRUCTION:
@@ -367,6 +368,7 @@ symbol_table::process_new_functions (void)
          gcc_unreachable ();
          break;
        }
+      bitmap_obstack_release (NULL);
     }
 
   cgraph_new_nodes.release ();
diff --git a/gcc/testsuite/gcc.dg/graphite/pr116068.c b/gcc/testsuite/gcc.dg/graphite/pr116068.c
new file mode 100644 (file)
index 0000000..99ff4f8
--- /dev/null
@@ -0,0 +1,26 @@
+/* PR ipa/116068 */
+/* { dg-do compile { target { lto && { bitint && int128 } } } } */
+/* { dg-options "-Os -flto -ffat-lto-objects -floop-parallelize-all -ftree-parallelize-loops=2 --param=parloops-schedule=dynamic" } */
+
+#if __BITINT_MAXWIDTH__ >= 1024
+typedef _BitInt (1024) A;
+typedef __attribute__((__vector_size__ (16))) char B;
+typedef __attribute__((__vector_size__ (16))) int C;
+B a;
+A b;
+int c;
+unsigned int *p;
+
+void
+foo0 (unsigned _BitInt (512) x)
+{
+  C d = {};
+  _BitInt (1024) e = x | *(A *) __builtin_memset (&b, c, 8);
+  unsigned h = __builtin_stdc_first_leading_zero (*p);
+  C f = *(C *) __builtin_memset (&d, h, 6);
+  B g = (B) f;
+  a = g + (B) (__int128) e;
+}
+#else
+int i;
+#endif