https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102147
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 register 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 same), 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=4 min=3 max=139 profitable_p=1 stage2-gcc: build_object_conflict obj140(a140) px=4 min=3 max=139 profitable_p=0 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 should be an optimization. Should the data structure choice / algorithm choice depend on pointer size? Are the two algorithms supposed to generate the same results?