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]

Re: [testsuite] XFAIL for dg-debug testsuite


Eric Botcazou wrote:
It also XFAILs debug-[12].c on SPARC64 with optimization enabled.

Richard Henderson mentioned earlier that this worked on the alpha; I looked at why. The alpha has the return register r0 in a class by itself R0_REGS. This causes CLASS_LIKELY_SPILLED_P to be true, which prevents combine from merging the conditional move with the instruction that stores the result in the return register. The alpha is thus left with two instructions, one of which is in the body, and gets the debug info. However, on the sparc, the return register is not in a class by itself, combine merges the two instructions, and we are left with one instruction that sets the return register. There is no instruction in the body, and no debug info for the variable.


We can fix this if we make sure that we have at least one other instruction. One way to do that is to modify the testcase so that p is a global instead of a parameter. We thus need a load instruction. The other optimizations all occur as before, the block is optimized into a conditional move. Except this time the testcase works because the load is left in the body, and we get the debug info for the sparc.

If this is undesirable for some reason, then the testsuite patch you proposed is OK.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]