This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/25572] New: ppc64 -mminimal-toc trashes r30
- From: "anton at samba dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Dec 2005 00:16:17 -0000
- Subject: [Bug c/25572] New: ppc64 -mminimal-toc trashes r30
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
We found this problem when building a ppc64 Linux kernel. It turns out r30 was
not preserved in a function that was using a local TOC. The compiler used was:
gcc version 4.0.3 20051201 (prerelease) (Debian 4.0.2-5)
Although it seems to reproduce on older toolchains too (eg 3.4).
pinskia cut the original test case down to:
/* Compile with -m64 -O2 -mminimal-toc */
int per_cpu__kstat;
int *f()
{
int *__ptr;
asm volatile(";%0":"=g"(__ptr):"0"(&per_cpu__kstat));
return __ptr;
}
/*
.f:
ld 30,.LCTOC0@toc(2)
ld 9,.LC0-.LCTOC1(30)
mr 3,9
#APP
;3
#NO_APP
*/
--
Summary: ppc64 -mminimal-toc trashes r30
Product: gcc
Version: 4.0.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: anton at samba dot org
GCC target triplet: powerpc64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25572