From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B2FA0382DE38; Wed, 26 Oct 2022 17:52:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B2FA0382DE38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666806770; bh=u/5OYkZAQS8JIC1xoHEAG5B+7RUXUidxn5yJkzUFnbg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AkwmWdGzLVY3UJAWch62S/+2t16rZRORm+Fc+JvPFBCGsJEsq2MceSM/ekvohhOiY TbP9C1698CvGDIIJDhjfQflQWX4UVwMT4OVnOEIBU8JFSCg83YWQe1TL0UEa6QepzT XZ2Q5AhPxLTVa8X0bLd4kqyy/vQ3o2LHjSA5aZVo= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/107411] trivial-auto-var-init=zero invalid uninitialized variable warning Date: Wed, 26 Oct 2022 17:52:50 +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: 13.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: everconfirmed bug_status 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=3D107411 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2022-10-26 --- Comment #1 from Andrew Pinski --- Confirmed. reduced testcase: int t(); void f(int); void j() { const int& e =3D t(); f(e); } Someone who understands the uininit pass should look into this but the IR at that point we get is (with -fno-exceptions due to extra clobbers otherwise which don't make a difference): _1 =3D .DEFERRED_INIT (4, 2, &"D.2374"[0]); D.2374 =3D _1; e_6 =3D .DEFERRED_INIT (8, 2, &"e"[0]); _2 =3D t (); D.2374 =3D _2; e_9 =3D &D.2374; _3 =3D *e_9; f (_3); D.2374 =3D{v} {CLOBBER(eol)}; There is no read from D.2374 in the call to t at all and then we do a full write after the call.=