From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B65943858415; Mon, 29 Aug 2022 13:08:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B65943858415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661778508; bh=+mEgPg5pYzRmoXPctcetVCAQK4sH00yirunYGzyyNcI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=i7LGhVUDQt0bfo+iVAnvVT5Cw5y+PcDriSkHmgccCuaxzmue9zkk9h/dk/nZWcDVg TPYrtj8VSrvR/8FcaYwVUfH78R8XTC6dfNOJVgZfhNes6IqLj3MOsdbx1gtvkzQbGZ R6AOc15xScvLF/Q2m+qIpm1PUTczbPXfI3P5NpCo= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/19430] taking address of a var causes missing uninitialized warning (virtual PHI with MEM) Date: Mon, 29 Aug 2022 13:08:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 3.4.2 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D19430 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2005-05-03 18:04:44 |2022-8-29 --- Comment #37 from Richard Biener --- Re-confirmed for the original testcase. The issue is that while we now try= to perform uninitialized diagnostics for memory we do not perform the maybe-un= init analysis via PHIs we do for non-memory. We see [local count: 1073741824]: # .MEM_5 =3D VDEF <.MEM_3(D)> _1 =3D bar (i_4(D)); if (_1 !=3D 0) goto ; [33.00%] else goto ; [67.00%] [local count: 719407024]: goto ; [100.00%] [local count: 354334800]: # .MEM_6 =3D VDEF <.MEM_5> baz (&j); [local count: 1073741824]: # .MEM_2 =3D PHI <.MEM_5(5), .MEM_6(3)> # VUSE <.MEM_2> _7 =3D j; so when we are walking and looking for defs of 'j' by means of walk_aliased_vdefs but that will simply process MEM_6 "unordered" and record that as possible definition. We are not properly forking the walk to discover a path where 'j' is not initialized nor are we trying to compute predicates which guard the use.=