From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7FEC93858D35; Mon, 22 Nov 2021 10:55:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7FEC93858D35 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug testsuite/103282] New test case gcc.dg/tree-ssa/modref-dse-5.c in r12-5292 fails Date: Mon, 22 Nov 2021 10:55:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: testsuite X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 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: Mon, 22 Nov 2021 10:55:55 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103282 --- Comment #9 from Jan Hubicka --- So the problem is that dse is giving up on determining if partial stores was killed. This is completely unnecesary: one can kill partial store by a full store. diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c index 9531d892f76..c07782d680b 100644 --- a/gcc/tree-ssa-dse.c +++ b/gcc/tree-ssa-dse.c @@ -197,11 +197,11 @@ normalize_ref (ao_ref *copy, ao_ref *ref) } poly_int64 diff =3D copy->offset - ref->offset; - if (maybe_le (ref->size, diff)) + if (maybe_le (ref->max_size, diff)) return false; /* If COPY extends beyond REF, chop off its size appropriately. */ - poly_int64 limit =3D ref->size - diff; + poly_int64 limit =3D ref->max_size - diff; if (!ordered_p (limit, copy->size)) return false; @@ -266,8 +266,12 @@ static bool setup_live_bytes_from_ref (ao_ref *ref, sbitmap live_bytes) { HOST_WIDE_INT const_size; - if (valid_ao_ref_for_dse (ref) - && ref->size.is_constant (&const_size) + if (ao_ref_base (ref) + && known_size_p (ref->max_size) + && known_ge (ref->offset, 0) + && multiple_p (ref->offset, BITS_PER_UNIT) + && multiple_p (ref->max_size, BITS_PER_UNIT) + && ref->max_size.is_constant (&const_size) && (const_size / BITS_PER_UNIT <=3D param_dse_max_object_size)) {=