From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DA199396E850; Mon, 13 Nov 2023 09:37:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA199396E850 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699868252; bh=YMEr9egmeyCYzO5VFFyn4+xWvrRvaNagiaE6OKe3I3c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gYcGigMyRMIzWESrIchNx0F6dZeebC3LlWC8q+quFmmEcfudlvMjOV2HgHzL2H/bw 8j9EfB5VwsxLhOzU1NX/JXKpnDBvoIpoINAQTFFTZQuEiOidGJkU8p5oMGOcOpX2Jl Ylzx/lT3DNZuRsUyiitjuoKscIEoX43tpdPm7E2U= From: "manolis.tsamis at vrull dot eu" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/112415] [14 regression] Python 3.11 miscompiled on HPPA with new RTL fold mem offset pass, since r14-4664-g04c9cf5c786b94 Date: Mon, 13 Nov 2023 09:37:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: manolis.tsamis at vrull dot eu 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: 14.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=3D112415 --- Comment #45 from Manolis Tsamis --- (In reply to Jeffrey A. Law from comment #41) > I would agree. In fact,the whole point of the f-m-o pass is to bring tho= se > immediates into the memory reference. It'd be really useful to know why > that isn't happening. >=20 > The only thing I can think of would be if multiple instructions needed the > %r20 in the RTL you attached. Which might point to a refinement we should > make in f-m-o, specifically the transformation isn't likely profitable if= we > aren't able to fold away a term or fold a constant term into the actual > memory reference. Jeff, I'm confused about "It'd be really useful to know why that isn't happening.= ". It can be seen in Dave's dumps that it *is* happening, e.g.: Memory offset changed from 0 to 396 for instruction: (insn 281 280 284 30 (set (mem:SI (reg/f:SI 20 %r20 [480]) [4 MEM[(int *)_1= 07 + 396B]+0 S4 A32]) (reg:SI 12 %r12 [orig:134 vect_pretmp_36.2452 ] [134])) "../Python/compile.c":5970:20 42 {*pa.md:2193} (nil)) Instruction folded:(insn 280 277 281 30 (set (reg/f:SI 20 %r20 [480]) (plus:SI (reg/f:SI 19 %r19 [orig:127 prephitmp_37 ] [127]) (const_int 396 [0x18c]))) "../Python/compile.c":5970:20 120 {addsi3} (nil)) If you looks at the RTL in f-m-o all these offsets are indeed moved in the respective load/store. I don't know if cprop afterwards manages to eliminate the unwanted move, but f-m-o does what it's supposed to do in this case.=