This is the mail archive of the gcc-bugs@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]

[Bug middle-end/24644] [4.1 Regression] gcc-4.1 compiled ppc64 kernels do not boot



------- Comment #11 from bergner at vnet dot ibm dot com  2005-11-04 05:52 -------
I've determined why we're dying, but not sure who is at fault yet.  While
scanning through Olaf's assembly diff's, I noticed some code that normally
wouldn't be a problem in user code, but is problamatic in PPC64 kernel code:

New code:
    mr r24, r13
    [snip]
    ld r9,360(r24)

Old code:
    [snip]
    ld r9, 360(r13)

The problem here is that r13 is a reserved register for the kernel (local_paca
pointer) and can change values on a context switch if we migrate to another
processor. so copying the value out of r13 is a no no.  Given what Olaf was
seeing, this seems to be the case here.

The problamatic source line is from linux-2.6.X/include/asm-ppc64/paca.h:

    register struct paca_struct *local_paca asm ("r13");

Changing this to:

    register struct paca_struct * volatile local_paca asm ("r13");

gave this warning message:
    warning: volatile register variables don't work as you might wish

It's only a warning and looking at the disassembly, the code looks good.  Olaf,
can you add the volatile above an try booting again?  Talking with Paulus, he
isn't too trilled about the warning message which will occur for every file
that uses current (lots!) so we're still not sure if there is a different
kernel fix/tweek for this to whether gcc needs to change or both.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24644


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