From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8D3EB3858C74; Tue, 9 Jan 2024 12:09:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D3EB3858C74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704802168; bh=Tgk++sLUstCV+ognhhZ/qfOryY9EuMBHvQgN5seo6Vw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=omKC1odFxrOjoQjGXHJ3/DDfcaKNM6CL3aiBowgxe+T6xt6mygLPXL5PaQqKUZA6t C6ZnQJSjDFmL4LK/nYTLu8TJpmSxAhAbwpwoKFl/A8eA/f6fx4HsvEqyLqLmv2aJY0 3gc2QCNUTtKPwmwJdv9d1GBsTS7xPPEFl6cw27iw= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113255] [11/12/13/14 Regression] wrong code with -O2 -mtune=k8 Date: Tue, 09 Jan 2024 12:09:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 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=3D113255 --- Comment #9 from Richard Biener --- So this: static void expand_set_or_cpymem_prologue_epilogue_by_misaligned_moves (rtx destmem, rtx srcmem, ... /* See how many bytes we skipped. */ saveddest =3D expand_simple_binop (GET_MODE (*destptr), MINUS, savedd= est, *destptr, saveddest, 1, OPTAB_DIRECT); /* Adjust srcptr and count. */ if (!issetmem) *srcptr =3D expand_simple_binop (GET_MODE (*srcptr), MINUS, *srcptr, saveddest, *srcptr, 1, OPTAB_DIRECT); is the problematical op, but I'm not seeing an easy way to avoid the MINUS here. It's also difficult to match (minus (..) (and ... aligning-cst)) in find_base_term as the AND is exposed via CSELIB values only. find_base_term is known broken but base_alias_check continues to be "useful" for aliasing with spill slots mostly. find_base_term tries to do ad-hoc points-to analysis but is not conservative in any way - it doesn't even have a way to say a final "I don't know" which means there's no way to perform a conservative correction to it. In fact I don't think we can make it conservative.=