From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5DCF2385843E; Tue, 9 Jan 2024 10:20:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5DCF2385843E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704795651; bh=4NgznjvcvxvTtNtGtC5jKH/KKL+HPyeV+WUIuR5AADY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aTly31iVC9aqHDkyQPZGMQGFUXp61OUsvQiR2SHv+ctdUso2iDvn1w18Xrs1XkWJv L3Op2BoRezUU/giYIGK92VuyRcXX5pjmyEXeTGhtTF182qsnkrQGrc87JHuGP9WQzW ex2oHlJEJkszgkLAl7NPkEgC6QFCCKA5JwuM91TE= 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 10:20:50 +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: see_also 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 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D49330, | |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D53705 --- Comment #8 from Richard Biener --- 3: NOTE_INSN_FUNCTION_BEG 8: r134:DI=3Dconst(`g'+0x44) 9: {r133:DI=3Dframe:DI-0x4c;clobber flags:CC;} REG_UNUSED flags:CC ... 56: r129:DI=3Dconst(`g'+0x4c) 57: {r129:DI=3Dr129:DI&0xfffffffffffffff8;clobber flags:CC;} REG_UNUSED flags:CC REG_EQUAL const(`g'+0x4c)&0xfffffffffffffff8 58: {r118:DI=3Dr134:DI-r129:DI;clobber flags:CC;} REG_DEAD r134:DI REG_UNUSED flags:CC REG_EQUAL const(`g'+0x44)-r129:DI 59: {r119:DI=3Dr133:DI-r118:DI;clobber flags:CC;} REG_DEAD r133:DI REG_UNUSED flags:CC so the source is &e.. - ((&g+0x44) - (&g+0x44)&0xfff...8) that is, the original source adjusted by the alignment prologue amount which is aligning the destination. That's a classical example for where find_base_term is confused. I'm not sure there's a way to "obfuscate" things here. I think find_base_term ignores paths with & (align ops) but it goes down the subtract base path here. So maybe instead of subtracting using & (align-1) for that would work.=