From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 774 invoked by alias); 4 Nov 2005 05:52:39 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 741 invoked by uid 48); 4 Nov 2005 05:52:36 -0000 Date: Fri, 04 Nov 2005 05:52:00 -0000 Message-ID: <20051104055236.740.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/24644] [4.1 Regression] gcc-4.1 compiled ppc64 kernels do not boot In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "bergner at vnet dot ibm dot com" X-SW-Source: 2005-11/txt/msg00584.txt.bz2 List-Id: ------- 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