From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 99D623858C54; Tue, 13 Jun 2023 02:03:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99D623858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686621783; bh=UUTUUiY2ot7AkZBPt2GTV2iOz7isJcBdZowUN12KwkU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=G1JXdxdDpGBrYooPYr4+4Qm+b7fIQkdrh0g8Tx/2xdb3y5RG+bM2vDA/DTYBDUFtM 6szO/yldt6oCpmQkNByErdpPrhodBQLgKMazWOCG8jqOVec00XbWvpP4c3SsiNt0dh U51WLr7lfpagxrMpx3ZYFKUx73uBRk/CIVGK4ISI= From: "vincent-gcc at vinc17 dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106155] [12/13/14 Regression] spurious "may be used uninitialized" warning Date: Tue, 13 Jun 2023 02:03:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: diagnostic, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: vincent-gcc at vinc17 dot net X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D106155 --- Comment #12 from Vincent Lef=C3=A8vre -= -- Here's a similar, simpler testcase: int f1 (void); void f2 (int); long f3 (long); void tst (void) { int badDataSize[3] =3D { 1, 1, 1 }; for (int i =3D 0; i < 3; i++) { int emax; if (i =3D=3D 2) emax =3D f1 (); int status =3D f3 (badDataSize[i]); if (f1 ()) f1 (); if (status) f1 (); if (i =3D=3D 2) f2 (emax); } } gcc-12 (Debian 12.2.0-14) 12.2.0 warns at -O1, but not at -O2. gcc-13 (Debian 13.1.0-5) 13.1.0 is worse, as it warns at both -O1 and -O2.=