From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 745153858D35; Thu, 13 Apr 2023 13:08:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 745153858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681391288; bh=w/+iYki40wyxkkWtAAg7bRRHeuvAv17CrWWDF1uTp80=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BgbSRfMSJyxzau2tzXRthmuzyWyEzDta3XzbyqhyL8buyhJ4GV9CApQzciq18C1Um nUDL1Tk/wMQoOLSEQx3qvGOMVDHvZIFqQPDn7VfpKjirYjNCTkYJZSB6ylv5oeFd3j FV7qvOuNWtAC6NUzBLeSCZq22JmEvHoyzuIVO/8k= From: "xry111 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: Thu, 13 Apr 2023 13:08:08 +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: xry111 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 #14 from Xi Ruoyao --- (In reply to rguenther@suse.de from comment #13) > On Thu, 13 Apr 2023, chenglulu at loongson dot cn wrote: >=20 > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108357 > >=20 > > --- Comment #10 from chenglulu --- > > (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 > > If the definition of the macro DEFAULT_SIGNED_CHAR is changed to 0, the= test > > case can pass the test. I guess it is because the definition of > > DEFAULT_SIGNED_CHAR affects the optimization of the ccp pass, resulting= in some > > blocks that cannot be removed, resulting in the failure of this test ca= se. >=20 > Can you check if making b unsigned fixes the test for you? If so > that's what we should do. It works=EF=BC=9A diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr108357.c b/gcc/testsuite/gcc.dg/tree-ssa/pr108357.c index 44c457b7a97..79cf371ef28 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr108357.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr108357.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-threadfull1" } */ -static char b; +static unsigned char b; static unsigned c; void foo(); short(a)(short d, short e) { return d * e; } But I'm still wondering why this is not an issue for x86_64.=