From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E613E3857375; Fri, 22 Apr 2022 03:04:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E613E3857375 From: "jiawei at iscas dot ac.cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102892] [12 Regression] Dead Code Elimination Regression at -O3 (trunk vs 11.2.0) Date: Fri, 22 Apr 2022 03:04:03 +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: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jiawei at iscas dot ac.cn X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: Fri, 22 Apr 2022 03:04:04 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102892 jiawei changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jiawei at iscas dot ac.cn --- Comment #11 from jiawei --- (In reply to Eric Botcazou from comment #8) I use the RISC-V target test and get the same result, and link fail with 'undefined reference to `foo`'. > The test fails (to link) on SPARC though, here's the .optimized dump at -= O3: >=20 > ;; Function main (main, funcdef_no=3D0, decl_uid=3D1488, cgraph_uid=3D1, > symbol_order=3D1) (executed once) >=20 > Removing basic block 8 > Removing basic block 9 > Removing basic block 10 > Removing basic block 11 > int main () > { > unsigned int ivtmp.8; > long int a; > long int _1; > void * _2; > unsigned int _17; >=20 > [local count: 44232128]: > if (a_9(D) !=3D 1) > goto ; [89.00%] > else > goto ; [11.00%] >=20 > [local count: 715863673]: > # ivtmp.8_23 =3D PHI > bar (); > _2 =3D (void *) ivtmp.8_23; > _1 =3D MEM[(long int *)_2]; > if (_1 =3D=3D 1) > goto ; [20.24%] > else > goto ; [79.76%] >=20 > [local count: 144890806]: > foo (); >=20 > [local count: 715863674]: > ivtmp.8_24 =3D ivtmp.8_23 + 4; > if (_17 !=3D ivtmp.8_24) > goto ; [66.67%] > else > goto ; [33.33%] >=20 > [local count: 238597362]: > ivtmp.8_7 =3D (unsigned int) &b; > _17 =3D ivtmp.8_7 + 8; > goto ; [100.00%] >=20 > [local count: 44232131]: > return 0; > }=