https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122767
Bug ID: 122767
Summary: unstable register allocation: dependency on host word
size
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: aoliva at gcc dot gnu.org
Target Milestone: ---
Created attachment 62854
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62854&action=edit
testcase that demonstrates the problem (as of commit
Compiling the same code with a 32- or 64-bits hosted compiler, targeting the
same 32-bit platform, occasionally produces different code, due to different
choices by the register allocator.
The attached testcase, reduced from cp/call.cc, gets different registers
selected depending on whether it's compiled on i686-linux-gnu or on
x86_64-linux-gnu with -m32.
The problem is that HARD_REG_SET's size depends on
HOST_BITS_PER_WIDEST_FAST_INT, and allocno_hard_regs_hasher::hash is affected
by its size, alignment requirements and endianness.
Do we care enough to trade some compile-time hashing performance for register
allocation stability?