From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DC5553858C27; Mon, 13 Nov 2023 13:20:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC5553858C27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699881602; bh=mHscMLC/ZAamUwkMrNFbeadcgqGuUY6nt+zvMtVhjN8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lOTbVPnoTvRBRRrdgPSCmpX+Dt2cOszLWgYItkhFLYKtuV+Vohkk84WOWl+biewZe N9Nn9YI+47VNK6l2J5/cn0Rhb4wfnhPigs9py0eW8HIXadxnnxx1A4OrJoA2xLe8Tv GVHQlH5/RcpHA5C0V7M1XMY9Tga7fI8zzIzpDTEc= 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 13:20:01 +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 #46 from Manolis Tsamis --- I have reproduced the segfault with f-m-o limited to only fold insn 272 from compiler_call_helper. The exact transformation is: Memory offset changed from 0 to 388 for instruction: (insn 273 272 276 30 (set (mem:SI (reg/f:SI 22 %r22 [478]) [4 MEM[(intD.1 *)_107 + 388B]+0 S4 A32]) (reg:SI 14 %r14 [orig:167 vect_pretmp_36.2448D.32932 ] [167])) "Python/compile.c":5970:20 42 {*pa.md:2193} (nil)) deferring rescan insn with uid =3D 273. Instruction folded:(insn 272 269 273 30 (set (reg/f:SI 22 %r22 [478]) (plus:SI (reg/f:SI 19 %r19 [orig:127 prephitmp_37 ] [127]) (const_int 388 [0x184]))) "Python/compile.c":5970:20 120 {addsi= 3} (nil)) This instruction is also included to the ones that Dave mentioned. Again, if I'm missing something as to why this transformation is illegal please tell = me. Given these are also consecutive instructions, I'm just seeing here that=20 %r22 =3D %r19 + 388 [%r22] =3D %r14 is transformed to %r22 =3D %r19 [%r22 + 388] =3D %r14 I haven't tracked all other uses of %r22 yet, but in theory if there was any non-foldable use of that register then the transformation wouldn't be made. Manolis=