From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 145F63858D37 for ; Mon, 29 Aug 2022 12:18:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 145F63858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 7773522153 for ; Mon, 29 Aug 2022 12:18:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1661775514; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=tVS7dmRL6iKNRQtU32uw2XGora+n4RoepiYFppF+zfU=; b=C7pgO/mUasIvIuklhTK5d3/hVaQWLEK8f6dYwuenCIwUs7guHlSX8m5hxN4SQt5i6NZQun ZTyqEfHutW4njbFxQhvJ08f/5XbgjnV4KCIDmhLKJFaRdrDyWY1xwu1LkDx1IA3gzFipdf BcYTis+sh6BfXR9UQBg792F/TBSoSFc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1661775514; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=tVS7dmRL6iKNRQtU32uw2XGora+n4RoepiYFppF+zfU=; b=mma2+gzGntDLvBq77K3FZedC4RyH9pRqjNsSiGQYGpXTe8DY9DOovBzf2Jkzss57n/jnyk I+vhym7/JhabBQAg== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 722AC2C141 for ; Mon, 29 Aug 2022 12:18:34 +0000 (UTC) Date: Mon, 29 Aug 2022 12:18:34 +0000 (UTC) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Make uninit PHI processing more consistent Message-ID: User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: On Mon, 29 Aug 2022, Richard Biener wrote: [...] > The patch correctly diagnoses an uninitalized use of 'regnum' > in store_bit_field_1 but also diagnoses an uninitialized use of > best_match::m_best_candidate_len which I've chosen to silence > without analyzing it in detail (I'm doing that right now). To followup myself this is cpp_hashnode *best_macro = bmm.get_best_meaningful_candidate (); /* If a macro is the closest so far to NAME, use it, creating an identifier tree node for it. */ if (best_macro) { const char *id = (const char *)best_macro->ident.str; tree macro_as_identifier = get_identifier_with_length (id, best_macro->ident.len); bm.set_best_so_far (macro_as_identifier, bmm.get_best_distance (), bmm.get_best_candidate_length ()); and edit_distance_t get_cutoff (size_t candidate_len) const { return ::get_edit_distance_cutoff (m_goal_len, candidate_len); } candidate_t get_best_meaningful_candidate () const { /* If the edit distance is too high, the suggestion is likely to be meaningless. */ if (m_best_candidate) { edit_distance_t cutoff = get_cutoff (m_best_candidate_len); if (m_best_distance > cutoff) return NULL; } where the connection between m_best_candidate_len being initialized when m_best_candidate is not NULL is not visible. I think it's OK to initialize the member together with m_best_candidate here. I'm reducing a testcase, but not sure where that will go. Richard.