From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CE4D73858D35; Thu, 7 Mar 2024 03:21:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE4D73858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709781696; bh=WtSni9AhXj5DYLdupS5lqMGrWcinNEwg4vtRm6PYRYY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QrHuOIK+I2d5Ir8SEGtg6R4iKNqo8zNkF4w0qlr/xGpO2feHV0h0C4fOwoejTalI6 X5Y09jOEO7Ej2doZcA2u1EstUS3zyLceH2mLniMUUYeMd6ChtNeMByLMrchnoyGO4b QTSZFs5Zb5bgLue6pinat68Zj3OZTe2CYcaqnhGI= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114253] False positive maybe-uninitialized with std::optional and ternary Date: Thu, 07 Mar 2024 03:21:36 +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: 8.3.0 X-Bugzilla-Keywords: diagnostic, missed-optimization 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: keywords 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=3D114253 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization --- Comment #5 from Andrew Pinski --- ``` [local count: 1073741824]: # pid_16 =3D PHI # pid$4_26 =3D PHI kill_pid (0); goto ; [100.00%] [count: 0]: : goto ; [100.00%] [local count: 1073741824]: _12 =3D VIEW_CONVERT_EXPR(pid$4_26); if (_12 !=3D 0) goto ; [33.00%] else goto ; [67.00%] [local count: 354334800]: kill_pid (pid_16); goto ; [100.00%] ``` Funny if we turn off SRA we get: ``` [local count: 354334800]: _2 =3D MEM[(int &)&pid]; kill_pid (_2); goto ; [100.00%] [count: 0]: : goto ; [100.00%] [local count: 536870912]: kill_pid (_2); [local count: 536870912]: goto ; [100.00%] ``` (note bb9/bb17 here looks to be landing pads for EH).=