This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Uros Bizjak <ubizjak@gmail.com> writes:
Hello!
Currently, we use %rbx as REAL_PIC_OFFSET_TABLE_REGNUM on x86_64. Since this register gets marked as fixed reg in ix86_conditional_register_usage, we get into troubles with insns that use %rbx (cmpxchg, cpuid). According to x86_64 psABI, we are free to use any register, so attached patch changes %rbx with %r15 (also following the example in the psABI). This patch has no implications on small code model (that doesn't use REAL_PIC_OFFSET_TABLE_REGNUM anyway), but on medium and large code model fixes usage of cpuid.h (please see PR 55712 [1]) and avoids a pair of xchgs around cmpxchg or cpuid instructions.
So everyone who worked around this and use r15 now broke.
It would be probably better to just teach the register allocator to spill those registers as needed, to handle some asm() statement. Not sure how hard that would be.
-Andi
--
ak@linux.intel.com -- Speaking for myself only
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |