From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 91B653858403; Sat, 25 Sep 2021 07:51:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 91B653858403 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/100112] missed optimization for dead code elimination at -O3, -Os (vs. -O1, -O2) Date: Sat, 25 Sep 2021 07:51:07 +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: 11.0 X-Bugzilla-Keywords: alias, 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 component 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2021 07:51:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100112 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |alias Component|ipa |tree-optimization --- Comment #2 from Andrew Pinski --- Hmm, the difference is in fre, for some reason -fstrict-aliasing makes a difference. ealias at -O1: c.1_4 =3D c; c =3D c.1_4; c.2_5 =3D c; _6 =3D c.2_5 !=3D 0B; ealias at -O3: *a.0_1 =3D _3; c.1_4 =3D c; c =3D c.1_4; c.2_5 =3D c; _6 =3D c.2_5 !=3D 0B; fre1 at -O1: *a.0_1 =3D _3; c.1_4 =3D c; _6 =3D c.1_4 !=3D 0B; fre1 at -O3: *a.0_1 =3D _3; c.1_4 =3D c; c =3D c.1_4; _6 =3D c.1_4 !=3D 0B; fre1 at -O1 dump: Value numbering stmt =3D c =3D c.1_4; Store matched earlier value, value numbering store vdefs to matching vuses. fre1 at -O3 dump: Value numbering stmt =3D c.1_4 =3D c; Setting value number of c.1_4 to c.1_4 (changed) Making available beyond BB2 c.1_4 for value c.1_4 Value numbering stmt =3D c =3D c.1_4; No store match Value numbering store c to c.1_4 Setting value number of .MEM_11 to .MEM_11 (changed) If I use -O3 -fno-strict-aliasing, I get the same result as -O1.=