From dd389c2549a4891e044c96b9298efa2a363c744a Mon Sep 17 00:00:00 2001 From: Jakub Jelinek <jakub@redhat.com> Date: Wed, 15 Jan 2025 09:43:32 +0100 Subject: [PATCH] ipa: Initialize/release global obstack in process_new_functions [PR116068] 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 | 2 ++ gcc/testsuite/gcc.dg/graphite/pr116068.c | 26 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/graphite/pr116068.c diff --git a/gcc/cgraphunit.cc b/gcc/cgraphunit.cc index 284a22bb808f..82f205488e90 100644 --- a/gcc/cgraphunit.cc +++ b/gcc/cgraphunit.cc @@ -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 index 000000000000..99ff4f8f2e3f --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr116068.c @@ -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 -- GitLab