On Tue, May 12, 2026 at 2:13 PM Uros Bizjak <[email protected]> wrote: > > On Tue, May 12, 2026 at 2:42 AM H.J. Lu <[email protected]> wrote: > > > > DRAP register is used to restore stack pointer in epilogue for stack > > realignment. In no-callee-saved and preserve_none functions, although > > DRAP register isn't preserved, it must be unchanged between prologue > > and epilogue so that stack pointer can be restored. In no-callee-saved > > and preserve_none functions, mark BX_REG as fixed and use it for DRAP > > register. > > > > NB: r12-r15 aren't made available as the local general purpose registers > > since it causes: > > > > FAIL: gcc.target/i386/preserve-none-1.c scan-assembler-not movq > > FAIL: gcc.target/i386/preserve-none-30a.c check-function-bodies entry > > FAIL: gcc.target/i386/preserve-none-30b.c check-function-bodies entry > > > > which have the same cause as > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124798 > > > > gcc/ > > > > PR target/120870 > > * config/i386/i386.cc (X86_NO_CALLEE_DRAP_REG): New. > > (ix86_conditional_register_usage): Mark X86_NO_CALLEE_DRAP_REG > > as fixed. > > (find_drap_reg): Return X86_PRESERVE_NONE_DRAP_REG for > > no-callee-saved and preserve_none functions > > > > gcc/testsuite/ > > > > PR target/120870 > > * gcc.target/i386/pr120870-1.c: New test. > > * gcc.target/i386/pr120870-2.c: Likewise. > > + /* Disabled to avoid > + > +FAIL: gcc.target/i386/preserve-none-1.c scan-assembler-not movq > +FAIL: gcc.target/i386/preserve-none-30a.c check-function-bodies entry > +FAIL: gcc.target/i386/preserve-none-30b.c check-function-bodies entry > + > + which have the same cause as > + > + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124798 > + > + */ > + if (0 && TARGET_64BIT) > + { > + /* Make R12_REG, R13_REG, R14_REG, R15_REG available as > + the local general purpose registers. */ > + call_used_regs[R12_REG] = 1; > + call_used_regs[R13_REG] = 1; > + call_used_regs[R14_REG] = 1; > + call_used_regs[R15_REG] = 1; > + } > > Why is this disabled part needed in this particular patch? >
I am working on a fix to enable it. Should I sent a v2 patch without it? -- H.J.
