From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 1920C3858415 for ; Fri, 5 Apr 2024 13:52:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1920C3858415 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 1920C3858415 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712325143; cv=none; b=G1/lohs5iBrw1jZAhFvSQDSiZKWxs/wA3ACsu+vo8OKLtn5QqXRirQGqGyI7TLiZF/esDeE7UmhwZZMOE7ahhm5wDHgbonmbNqQrU+7gZdS/zr96iTgUzNd2qgOw1glgDfTwv0l5Rxre2ATSgiUkzjRY//bTVw20kujamF4SR84= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712325143; c=relaxed/simple; bh=URA4S8xicaYiZMiu6i/VdqJsgVTGaZqbrLLerMfuuF0=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: Mime-Version:Subject:Date:Message-Id:To; b=lLGkuaGZ+uvusS1FgUo0H6JYfIz1z0Lq28iG11J9bJYa5NPAyNsdHkgaR4sanCjgb4lEVA8UUGROjmrksz6Ib2r09BDdzb16I/qkIwTiQJ2dSbslmrtp2VajK6KICR/WkN1zhxM6AOElXwWKpa6KUPJNZ+gx+0nbsGLYLneauk4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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-out2.suse.de (Postfix) with ESMTPS id C59541F7B8; Fri, 5 Apr 2024 13:52:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712325140; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fLuaa7dcVrjIge/lz3SXpjZqkQJK2cDSRSebTnC4gwA=; b=KcyTp4xb68uZdKWIQpxMEycSWcSVeUZkBP9wldHWgM3SS0crm3HU8bjiyK5SMF8KPb/1hp HWmk5uwoNS8Iisd2BMHs+LFEOKUpfPvpC0mYnayBvhHQS/2KRwdzqCPEfQyFgs4A0D6pRT aMhgHVVlU1fBqXrh7BEIjbSXdhEd8A8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712325140; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fLuaa7dcVrjIge/lz3SXpjZqkQJK2cDSRSebTnC4gwA=; b=E90NU27fbeQ9PXt/YfXrdJr5P4EFqFjXKaAI4gJRy7+xHR7HuLdkLUd3vlHnApUVFrTz38 rxs03jxKGbsiinCw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=jrBNhLDN; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=vjvGLA1o DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712325139; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fLuaa7dcVrjIge/lz3SXpjZqkQJK2cDSRSebTnC4gwA=; b=jrBNhLDNQxtxZfJMf6HUyhrzlk44Smy5AYaFTR9lT0al8X3B+UbO5MwH9XYqnF+3WKAb6C HxT8is3ZSPrZ4imbLGTv62CWSS+u1TOP1Gw2QTJtDyzr4IMwvEYAY2/cuRniXEgG1iN87Y ghEEJDxWNx87opgRVjI/iS9edpobqYs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712325139; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fLuaa7dcVrjIge/lz3SXpjZqkQJK2cDSRSebTnC4gwA=; b=vjvGLA1o4WgCJAwaDNmh687sDUui2Q1Xe4x2KXFYbFrjvIO71kaG7v8RBkS9kJNmIKti58 27GoIU4rp9i+MhCQ== 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 AF590139F1; Fri, 5 Apr 2024 13:52:19 +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 4rPLKhMCEGZ2NwAAn2gu4w (envelope-from ); Fri, 05 Apr 2024 13:52:19 +0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Richard Biener Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] middle-end/114599 - fix bitmap allocation for check_ifunc_callee_symtab_nodes Date: Fri, 5 Apr 2024 15:52:09 +0200 Message-Id: <45F6FFF1-2F0C-420F-BCBB-503E4C0DDAF6@suse.de> References: Cc: gcc-patches@gcc.gnu.org In-Reply-To: To: "H.J. Lu" X-Mailer: iPhone Mail (21E236) X-Spam-Level: X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; RCPT_COUNT_TWO(0.00)[2]; FUZZY_BLOCKED(0.00)[rspamd.com]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:98:from]; TO_DN_SOME(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_RCPT(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; APPLE_IOS_MAILER_COMMON(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap2.dmz-prg2.suse.org:helo,imap2.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:email] X-Rspamd-Action: no action X-Rspamd-Queue-Id: C59541F7B8 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: -4.51 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,KAM_SHORT,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 List-Id: > Am 05.04.2024 um 15:46 schrieb H.J. Lu : >=20 > =EF=BB=BFOn Fri, Apr 5, 2024 at 1:21=E2=80=AFAM Richard Biener wrote: >>=20 >> There's no default bitmap obstack during global CTORs, so allocate the >> bitmap locally. >>=20 >> Bootstrap and regtest running on x86_64-unknown-linux-gnu. >>=20 >> Richard. >>=20 >> 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(-) >>=20 >> 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; >> } >>=20 >> -static auto_bitmap ifunc_ref_map; >> +static bitmap ifunc_ref_map; >>=20 >> /* Return true if any caller of NODE is an ifunc resolver. */ >>=20 >> @@ -1404,9 +1404,8 @@ is_caller_ifunc_resolver (cgraph_node *node) >>=20 >> /* Skip if it has been visited. */ >> unsigned int uid =3D 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); >>=20 >> if (is_caller_ifunc_resolver (e->caller)) >> { >> @@ -1437,6 +1436,9 @@ symtab_node::check_ifunc_callee_symtab_nodes (void)= >> { >> symtab_node *node; >>=20 >> + bitmap_obstack_initialize (NULL); >> + ifunc_ref_map =3D BITMAP_ALLOC (NULL); >> + >> FOR_EACH_SYMBOL (node) >> { >> cgraph_node *cnode =3D dyn_cast (node); >> @@ -1455,7 +1457,8 @@ symtab_node::check_ifunc_callee_symtab_nodes (void)= >> cnode->called_by_ifunc_resolver =3D true; >> } >>=20 >> - bitmap_clear (ifunc_ref_map); >> + BITMAP_FREE (ifunc_ref_map); >> + bitmap_obstack_release (NULL); >> } >>=20 >> /* Verify symbol table for internal consistency. */ >> -- >> 2.35.3 >=20 > The bug isn't fixed: >=20 > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114599#c5 Ah, I reproduced with -coverage and that is fixed now. The still existing b= ug must be something unrelated. Richard=20 >=20 > -- > H.J.