From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A2E603858C41; Wed, 8 Nov 2023 10:09:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A2E603858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699438165; bh=RFf5hKNq2Yeymx4/hpiFsUbtM9eotLUdH27xwm5Eark=; h=From:To:Subject:Date:In-Reply-To:References:From; b=E5atiu64JswmW+zaxOQqEN1zeWLLaSKSWA5NndbXrFBmKvL3Eu7JRHQ1nRfkXCPnH t2npOTNrWU/gOXsa1Ucy5h/IUwUSCAHosQGTfYmcBqPflmhPOXz+PK69/iw+R/6vZo 4SN2IpTZ3vCPT2OP+7Zb0gpA7nbkbChYjU/ZiI/0= 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: Wed, 08 Nov 2023 10:09:23 +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: UNCONFIRMED 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 #15 from Manolis Tsamis --- (In reply to Sam James from comment #13) > Created attachment 56527 [details] > compile.c.323r.fold_mem_offsets.bad.xz >=20 > Output from > ``` > hppa2.0-unknown-linux-gnu-gcc -c -DNDEBUG -g -fwrapv -O3 -Wall -O2=20=20 > -std=3Dc11 -Werror=3Dimplicit-function-declaration -fvisibility=3Dhidden= =20 > -I/home/sam/git/cpython/Include/internal -IObjects -IInclude -IPython -I. > -I/home/sam/git/cpython/Include -DPy_BUILD_CORE -o Python/compile.o > /home/sam/git/cpython/Python/compile.c -fdump-rtl-fold_mem_offsets-all > ``` >=20 > If I instrument certain functions in compile.c with no optimisation > attribuet or build the file with -fno-fold-mem-offsets, Python works, so = I'm > reasonably sure this is the relevant object. Thanks for the dump file! There are 66 folded/eliminated instructions in th= is object file; I did look at each case and there doesn't seem to be anything strange. In fact most of the transformations are straightforward: - All except a couple of cases don't involve any arithmetic, so it's just moving a constant around. - The majority of the transformations are 'trivial' and consist of a single add and then a memory operation: a sequence like X =3D Y + Const, R =3D MEM= [X + 0] is folded to X =3D Y, R =3D MEM[X + Const]. I wonder why so many of these e= xist and are not optimized elsewhere. - There are some cases with negative offsets, but the calculations look correct. - There are few more complicated cases, but I've done these on paper and a= lso look correct. Of course I could be missing some more complicated effect, but what I want = to say is that everything looks sensible in this particular file. > Thanks! You are very welcome to have access to some HPPA machines for > this kind of work. Please email me an SSH public key + desired username > if that sounds helpful. Yes, since I couldn't find anything interesting in the dump, that would definitely be helpful. Thanks! Manolis=