From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3F8863858410; Tue, 31 Aug 2021 15:13:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F8863858410 From: "dje at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/102147] New: IRA dependent on 32-bit vs 64-bit register size Date: Tue, 31 Aug 2021 15:13:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dje at gcc dot gnu.org 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Aug 2021 15:13:22 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102147 Bug ID: 102147 Summary: IRA dependent on 32-bit vs 64-bit register size Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: dje at gcc dot gnu.org Target Milestone: --- IRA heuristics chooses different data structure encodings based on the regi= ster size, and this produces different register allocation results. This was discovered by a GCC bootstrap comparison failure of tree-vect-slp.c when using a 32 bit compiler to bootstrap a 64 bit compiler. A difference occurs in ira-conflicts.c: build_object_conflicts(), for the same object with the same properties (i.e., min, max and px are the sam= e), the function ira_conflict_vector_profitable_p() will return 1 by stage1-gcc and 0 by stage2-gcc. stage1-gcc: build_object_conflict obj140(a140) px=3D4 min=3D3 max=3D139 profitable_p=3D1 stage2-gcc: build_object_conflict obj140(a140) px=3D4 min=3D3 max=3D139 profitable_p=3D0 That's because the size of ira_object_t being a pointer is different in stage1-gcc (which is 32bit) and stage2-gcc (which is 64bit). My colleagues at ATOS and I aren't completely certain how this difference causes different conflict / allocation behavior because it seems that it sh= ould be an optimization. Should the data structure choice / algorithm choice depend on pointer size?= =20 Are the two algorithms supposed to generate the same results?=