From patchwork Fri Apr 5 08:20:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1920069 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=soPyESuD; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=+TT5cZmf; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=soPyESuD; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=+TT5cZmf; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V9rzB6P1vz1yZH for ; Fri, 5 Apr 2024 19:20:53 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 407AD384641E for ; Fri, 5 Apr 2024 08:20:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id A80D13858C32 for ; Fri, 5 Apr 2024 08:20:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A80D13858C32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A80D13858C32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712305220; cv=none; b=fdVSphZYIo/sL2ln3m9yNT+erGZAHafv32C5usAl9710wYt+MPrBt70AP4wj8jXSbF5mJ7Elc84tFe2Sp+khI+A45gGwSYp5MoN5lv8BjyKy9a9W1K/CsnYtedQp09EIlJ3/8219ho67J1XosQ5ZZqsPDgeJOi7VqcrrPvyiJR0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712305220; c=relaxed/simple; bh=ERrOIgcazxX3P07LcrU93xhVQFooYZ1sRqKhzlyQdYs=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:MIME-Version:Message-Id; b=ovkyAK49RxzYmoR3bwsF0nDloj5mm3o3H19sVKcr7E/eYNXvjYou7H7CE7AcYWoXWLV6eVnbYeb9ae1a6xYZqU7mqA9KSB4vSPLJn3n+oWc6+TFnp3GZNWOZuSHgDdITtxWbfZGMGA9yl2s0AD3yzX2OCsrLYLod636ufvyRmPs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 81ED621A20 for ; Fri, 5 Apr 2024 08:20:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712305217; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=allnPNKFFAPYJiAK19N1B7y7E2t876cOr1e817Ys7WE=; b=soPyESuDJx+dF4ImjRSgD1O+OzeTeCBxvKDEPgzWt2w/BtwMuO/XDhpp7OsO1NytbsfBH4 dlMAEYrwcDOfo3fSzKifserU8qbvQHp+hvBgb1z9mlBmQIvXvDAJnZxkwqmGvDt9PCb8w7 QVtofuzcW1N+A7/ZTR+yBTeA9qf9jr4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712305217; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=allnPNKFFAPYJiAK19N1B7y7E2t876cOr1e817Ys7WE=; b=+TT5cZmfDENnd1wPNBSkK3LCH/kW/aJcUjNFk955RHN61TGkfCbzz3spMODayWG7jtvQnm siumRT6Fep8PLKCA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712305217; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=allnPNKFFAPYJiAK19N1B7y7E2t876cOr1e817Ys7WE=; b=soPyESuDJx+dF4ImjRSgD1O+OzeTeCBxvKDEPgzWt2w/BtwMuO/XDhpp7OsO1NytbsfBH4 dlMAEYrwcDOfo3fSzKifserU8qbvQHp+hvBgb1z9mlBmQIvXvDAJnZxkwqmGvDt9PCb8w7 QVtofuzcW1N+A7/ZTR+yBTeA9qf9jr4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712305217; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=allnPNKFFAPYJiAK19N1B7y7E2t876cOr1e817Ys7WE=; b=+TT5cZmfDENnd1wPNBSkK3LCH/kW/aJcUjNFk955RHN61TGkfCbzz3spMODayWG7jtvQnm siumRT6Fep8PLKCA== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 682C7139E8 for ; Fri, 5 Apr 2024 08:20:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id xDTBF0G0D2ZwQAAAn2gu4w (envelope-from ) for ; Fri, 05 Apr 2024 08:20:17 +0000 Date: Fri, 5 Apr 2024 10:20:09 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] middle-end/114599 - fix bitmap allocation for check_ifunc_callee_symtab_nodes MIME-Version: 1.0 Message-Id: <20240405082017.682C7139E8@imap2.dmz-prg2.suse.org> X-Spam-Score: -1.31 X-Spam-Level: X-Spamd-Result: default: False [-1.31 / 50.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; BAYES_HAM(-0.01)[48.01%]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; PREVIOUSLY_DELIVERED(0.00)[gcc-patches@gcc.gnu.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap2.dmz-prg2.suse.org:helo, imap2.dmz-prg2.suse.org:rdns] X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org There's no default bitmap obstack during global CTORs, so allocate the bitmap locally. Bootstrap and regtest running on x86_64-unknown-linux-gnu. Richard. PR middle-end/114599 * symtab.cc (ifunc_ref_map): Do not use auto_bitmap. (is_caller_ifunc_resolver): Optimize bitmap_bit_p/bitmap_set_bit pair. (symtab_node::check_ifunc_callee_symtab_nodes): Properly allocate ifunc_ref_map here. --- gcc/symtab.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gcc/symtab.cc b/gcc/symtab.cc index 3256133891d..3b018ab3ea2 100644 --- a/gcc/symtab.cc +++ b/gcc/symtab.cc @@ -1383,7 +1383,7 @@ check_ifunc_resolver (cgraph_node *node, void *data) return false; } -static auto_bitmap ifunc_ref_map; +static bitmap ifunc_ref_map; /* Return true if any caller of NODE is an ifunc resolver. */ @@ -1404,9 +1404,8 @@ is_caller_ifunc_resolver (cgraph_node *node) /* Skip if it has been visited. */ unsigned int uid = e->caller->get_uid (); - if (bitmap_bit_p (ifunc_ref_map, uid)) + if (!bitmap_set_bit (ifunc_ref_map, uid)) continue; - bitmap_set_bit (ifunc_ref_map, uid); if (is_caller_ifunc_resolver (e->caller)) { @@ -1437,6 +1436,9 @@ symtab_node::check_ifunc_callee_symtab_nodes (void) { symtab_node *node; + bitmap_obstack_initialize (NULL); + ifunc_ref_map = BITMAP_ALLOC (NULL); + FOR_EACH_SYMBOL (node) { cgraph_node *cnode = dyn_cast (node); @@ -1455,7 +1457,8 @@ symtab_node::check_ifunc_callee_symtab_nodes (void) cnode->called_by_ifunc_resolver = true; } - bitmap_clear (ifunc_ref_map); + BITMAP_FREE (ifunc_ref_map); + bitmap_obstack_release (NULL); } /* Verify symbol table for internal consistency. */