This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
gcc 4.5 powerpc wants r31
- From: Fabian Cenedese <Cenedese at indel dot ch>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 14 Sep 2011 15:08:14 +0200
- Subject: gcc 4.5 powerpc wants r31
Hi
Using a cross compiled gcc for PowerPC-CPUs: powerpc-eabi-gcc.exe --version
powerpc-eabi-gcc.exe (crosstool-NG-1.8.2) 4.5.2
I'm having a problem compiling some inline assembler code. This
works with older compilers but 4.5 doesn't like it.
register uint32 uFlags asm("r20") = 0;
asm volatile ("mr 31,%0": : "r" (uFlags) : "31");
Compiling unoptimized I get
file.cpp:3271:1: error: 31 cannot be used in asm here
Compiling with -O2 works.
Seems like this problem is already old (2006):
https://bugs.gentoo.org/show_bug.cgi?format=multiple;id=133948
http://www.stackless.com/pipermail/stackless/2006-August/002415.html
Is there a solution apart from -fomit-frame-pointer or "don't do this"?
Thanks
bye Fabi