gcc -pthread -c -mcpu=7450 -maltivec -mabi=altivec -fno-strict-aliasing -DNDEBUG -O3 -I. -I./Include -I./Stackless -DPy_BUILD_CORE -fno-omit-frame-pointer -O2 -I. -o Stackless/core/slp_transfer.o ./Stackless/core/slp_transfer.c ./Stackless/core/slp_transfer.c: In function 'slp_transfer': ./Stackless/core/slp_transfer.c:150: error: 31 cannot be used in asm here ./Stackless/core/slp_transfer.c:150: error: 31 cannot be used in asm here The file is: http://svn.python.org/projects/stackless/Python-2.4.3/dev/Stackless/core/slp_transfer.c and it compiles (and seems right) without -fno-omit-frame-pointer I hoped the recent upgrade (in testing) to 4.1.1-pre20060517 would solve it, but the error is still there.
try 4.1.1 ... if that fails, re-open with some preprocessed code for us to test with or some instructions on how to reproduce
with 4.1.1: LC_ALL=C LANG=C make gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -I./Stackless -DPy_BUILD_CORE -fno-omit-frame-pointer -O2 -I. -o Stackless/core/slp_transfer.o ./Stackless/core/slp_transfer.c ./Stackless/core/slp_transfer.c: In function 'slp_transfer': ./Stackless/core/slp_transfer.c:150: error: 31 cannot be used in asm here ./Stackless/core/slp_transfer.c:150: error: 31 cannot be used in asm here make: *** [Stackless/core/slp_transfer.o] Error 1 sgala@marlow ~/Code/stackless $ LC_ALL=C LANG=C gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -Wall -Wstrict-prototypes -I. -I./Include -I./Stackless -DPy_BUILD_CORE -fno-omit-frame-pointer -I. -o Stackless/core/slp_transfer.o ./Stackless/core/slp_transfer.c /tmp/ccr0UZXn.s: Assembler messages: /tmp/ccr0UZXn.s:65: Error: syntax error; found `(' but expected `,' /tmp/ccr0UZXn.s:65: Error: junk at end of line: `(31),1'
Created attachment 89702 [details] generated with gcc -E
with preprocessed output, not sure if this is enough
It seems to be an interaction between -fno-omit-frame-pointer and some sort of tail recursion elimination in return slp_switch(); at the very end of a function. It only compiles without -fno-omit-frame-pointer *and* optimization, so that omit-frame-pointer is done.
no, the ppc macro code is wrong in a few places for example: Greenlet/switch_ppc_macosx.h: __asm__ ("mr %0, r1" : "=g" (stackref) : ); this says that gcc is allowed to use register or memory for stackref ... but the "mr" instruction only works with registers change the constraint to "r" from "g" and it should work fine see the gcc manual for more info: http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Simple-Constraints.html#Simple-Constraints