From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 56C823858C2B; Wed, 29 Mar 2023 09:03:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 56C823858C2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680080605; bh=GJFt+Y0GM9dIfYU1L/rfzUXJSyYF+nEGy7+T7J7Mko8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MPb3Op7jx5U7GGVP3bpHRjVjw4NRSL49FENGLz+4+dfH1skeZadAsB8Inr+vZFlbb YdhpTrXWC+YSXIhPi9wqnRulk9WrsOp/7TExIuvAwFpvVbsBsSGyY0txmV559IO8g5 UH06HA/SpJLO1p9DLaQFFGFK2+MZRlHtZTzvWxS0= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108357] [13 Regression] Dead Code Elimination Regression at -O2 since r13-4607-g2dc5d6b1e7ec88 Date: Wed, 29 Mar 2023 09:03:24 +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: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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=3D108357 --- Comment #9 from Richard Biener --- (In reply to Xi Ruoyao from comment #7) > (In reply to Richard Biener from comment #6) > > (In reply to Xi Ruoyao from comment #5) > > > The test fails on loongarch64-linux-gnu. foo is kept in 114t.threadf= ull1, > > > but removed in 135t.forwprop3. > > >=20 > > > Does this mean something is wrong for LoongArch, or we should simply = check > > > the tree dump in a later pass (for e.g. 254t.optimized)? > >=20 > > I guess it depends on LOGICAL_OP_NON_SHORT_CIRCUIT, can you try > > --param logical-op-non-short-circuit=3D1 and see if that helps? >=20 > Nope, the result is same. Aha, the issue is missing promotions, already in .original: - short int g =3D a (5, (int) ((short int) b ^ 9854)); - f ((int) g); + short int g =3D a (5, (short int) b ^ 9854); + f (g); (+ is loongarch, - is x86_64) That results in different IL into threadfull1. On loongarch forwprop3 elides the branch, probably with the help of nonzero bits set by CCP.=