From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id 0E1503858C35 for ; Mon, 27 May 2024 12:57:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0E1503858C35 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 0E1503858C35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716814669; cv=none; b=Rc72lSoQ68wrYznhtaPI5pbZ9O6+nB4ZEC9nir2tvIM1eeQaQ0Opb4cOh0i5u6LIeRhRu1zx+zdwCeg3S9z18BnzgPyqNROf8CyjMDWk/b8sMB6z8o5X7rnlmlYuiI+OXvrDLOJmwkht6CB2OPucIhaJwHTv8LUolJsFRBPwWz0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716814669; c=relaxed/simple; bh=TiFGPwpCHMuPJ/VHR38YmWP7g4H+L36lbVpX+k8ko10=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:MIME-Version; b=rLk2zgfeLReTvqmt/nDyWVW3+8+UEPqkwmLAJijzFHMeVEfJdA72h/ad4bwtsy1vCL4yRQEVGa2p47gsgG9lwk2IZYbaeqHZiWO8zhF79bktMdP0nz4wu1mSBUCkM6H8aoA0ObXk0hbZ76MQz/pRz8XSIxLwQbNGuJYxa0D/UuY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from murzim.nue2.suse.org (unknown [10.168.4.243]) (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 F075621EC8 for ; Mon, 27 May 2024 12:57:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716814667; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=xLlaYM2zhrn6XnH8F39z2IOW7C9LWmlVS81CDu5guKg=; b=niw0Xf6bm2CUrQ+64w0kXXuIKw9Tfda3EFcGFAs1qVpJw3nqYQFVSW4X22Wm5irAwhrRRS Z/uX3etkgcxkiQkrfDA0jM6Jc0BWdqDmYlYS6lcZ4DchvW131CoFtd4beeVcSSb38TDhPb CVQ86ZuawNQCqRy7MQlJcXQoCUD3WpY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716814667; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=xLlaYM2zhrn6XnH8F39z2IOW7C9LWmlVS81CDu5guKg=; b=+VgxLll/N8AKcUd67MaWtx9NUlGlZYFJ+/nsmlSFKlhDqvZaSWEsWGHnBIj24CWrUj0aNI /9QlhfwXUfN88+AA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716814667; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=xLlaYM2zhrn6XnH8F39z2IOW7C9LWmlVS81CDu5guKg=; b=niw0Xf6bm2CUrQ+64w0kXXuIKw9Tfda3EFcGFAs1qVpJw3nqYQFVSW4X22Wm5irAwhrRRS Z/uX3etkgcxkiQkrfDA0jM6Jc0BWdqDmYlYS6lcZ4DchvW131CoFtd4beeVcSSb38TDhPb CVQ86ZuawNQCqRy7MQlJcXQoCUD3WpY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716814667; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=xLlaYM2zhrn6XnH8F39z2IOW7C9LWmlVS81CDu5guKg=; b=+VgxLll/N8AKcUd67MaWtx9NUlGlZYFJ+/nsmlSFKlhDqvZaSWEsWGHnBIj24CWrUj0aNI /9QlhfwXUfN88+AA== Date: Mon, 27 May 2024 14:57:46 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix points-to SCC collapsing bug MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spamd-Result: default: False [2.70 / 50.00]; NEURAL_SPAM_LONG(3.38)[0.966]; BAYES_HAM(-2.88)[99.51%]; MISSING_MID(2.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.990]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_ZERO(0.00)[0]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[] X-Spam-Score: 2.70 X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,MISSING_MID,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: Message-ID: <20240527125746.R9kdY970EGnCy5SrEKo8BWUT7aaDl-jMvNTj6w6aNdM@z> When points-to analysis finds SCCs it marks the wrong node as being part of a found cycle. It only wants to mark the node it collapses to but marked the entry node found rather than the one it collapses to. This causes fallout in the patch for PR115236 but generally weakens the points-to solution by collapsing too many nodes. Note that this fix might slow down points-to solving. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-ssa-structalias.cc (scc_visit): Mark the node we collapse to as being in a component. --- gcc/tree-ssa-structalias.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc index 3099658f100..53552b63532 100644 --- a/gcc/tree-ssa-structalias.cc +++ b/gcc/tree-ssa-structalias.cc @@ -1542,8 +1542,10 @@ scc_visit (constraint_graph_t graph, class scc_info *si, unsigned int n) graph->indirect_cycles[i - FIRST_REF_NODE] = lowest_node; } } + bitmap_set_bit (si->deleted, lowest_node); } - bitmap_set_bit (si->deleted, n); + else + bitmap_set_bit (si->deleted, n); } else si->scc_stack.safe_push (n); -- 2.35.3