This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/24644] [4.1 Regression] gcc-4.1 compiled ppc64 kernels do not boot
- From: "bergner at vnet dot ibm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Nov 2005 17:38:02 -0000
- Subject: [Bug middle-end/24644] [4.1 Regression] gcc-4.1 compiled ppc64 kernels do not boot
- References: <bug-24644-1216@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #15 from bergner at vnet dot ibm dot com 2005-11-04 17:38 -------
For completeness, here is a minimal test case that shows the problem we are
having:
bergner@vervain:~/olaf/PR24644-4> cat bar.c
register struct paca_struct * local_paca asm("r13");
struct paca_struct { volatile long state; };
extern void foo(void);
int migration_thread(void)
{
local_paca->state = 1;
foo();
local_paca->state = 0;
return 0;
}
bergner@vervain:~/olaf/PR24644-4> ~/gcc/dataflow-base/bin/gcc -m64 -O1 -S bar.c
The code we get looks like:
.migration_thread:
mflr 0
std 29,-24(1)
std 0,16(1)
stdu 1,-144(1)
mr 29,13
li 0,1
std 0,0(13)
bl .foo
nop
li 0,0
std 0,0(29)
li 3,0
addi 1,1,144
ld 0,16(1)
mtlr 0
ld 29,-24(1)
blr
This looks like gcc thinks r13 will be trashed by the call to foo() so it
copies it to a non volatile register for use after the call. Strange that this
didn't happen before the patch found by Olaf.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24644