From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 53E613858C98; Mon, 22 Apr 2024 23:35:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 53E613858C98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713828901; bh=y7bgsYyBJUAQdgEB7yFtdSx4PuUUg6R3s12OD6AJYb0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VwNt5XyF0Tmi/3eIc1J/D0D65zUyYo3IMIx1AvSsx93YA6n/CKoPMuNXz4dnwE1ml wMh9qx4AdKFBgwu9PIlKjx/dkjo3hmneawoIYUfc8+lfnkEk3QtEH4n2okx25BKhLo rJG1a7jr1sZ7uVK6mgpI/cBlZqNoCoDs33pyCSI8= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114800] DSE does not remove set-zero which is partial redundant Date: Mon, 22 Apr 2024 23:35:00 +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.2.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement 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: short_desc 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=3D114800 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|redundant set-zero when |DSE does not remove |initiate a struct |set-zero which is partial | |redundant --- Comment #3 from Andrew Pinski --- here is a testcase which shows the problem with when either front-ends: ``` struct thresh_restart { int *f0; int f1; int f2; int f3; }; int arr[10]; void __attribute__((noinline)) foo(struct thresh_restart *p) { arr[0] =3D p->f3; arr[1] =3D p->f1; } void func(int *b) { struct thresh_restart tr =3D {}; tr.f3 =3D 3; tr.f1 =3D 1; foo(&tr); } ```=