Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 133948 - gcc-4.1.0 and 4.1.1-pre20060517 fail to compile stackless python
Summary: gcc-4.1.0 and 4.1.1-pre20060517 fail to compile stackless python
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: PPC Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-21 08:04 UTC by Santiago Gala
Modified: 2006-06-24 19:05 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
generated with gcc -E (slp_transfer.pre,237.47 KB, text/plain)
2006-06-21 02:02 UTC, Santiago Gala
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Santiago Gala 2006-05-21 08:04:35 UTC
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.
Comment 1 SpanKY gentoo-dev 2006-06-20 17:21:27 UTC
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
Comment 2 Santiago Gala 2006-06-21 02:00:32 UTC
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'

Comment 3 Santiago Gala 2006-06-21 02:02:01 UTC
Created attachment 89702 [details]
generated with gcc -E
Comment 4 Santiago Gala 2006-06-21 02:02:45 UTC
with preprocessed output, not sure if this is enough
Comment 5 Santiago Gala 2006-06-21 02:11:29 UTC
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.
Comment 6 SpanKY gentoo-dev 2006-06-24 19:05:03 UTC
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