I am getting a failure Processing [14/127]: coroutines-01.flx sh: line 1: 1842 Segmentation fault "env" "DYLD_LIBRARY_PATH=build/release/host/lib/rtl:$DYLD_LIBRARY_PATH" "build/release/host/bin/flx_run" "/Users/johnskaller/.felix/cache/binary/Users/johnskaller/felix/test/regress/rt/coroutines-01.dylib" "test" > "/Users/johnskaller/.felix/cache/text/Users/johnskaller/felix/test/regress/rt/coroutines-01.stdout"
on my Mac using my clang 3.3 svn. This is with no optimisations. With -O1 it works. So this is probably a bug in clang. The code is doing some nasty hacks internally: it uses computed gotos in a way which should be perfectly safe if the jump address is valid, however the address in function A is taken in function B by using "assembler labels". This is a gcc trick which should work in clang too (and does with -O1). The -O flag should only impact C++ compilation, however I'm using a --prototype for testing which impacts the amount of inlining by flxg as well. So it could be that Felix inlining is making the hackery work, without which it doesn't. I think this works with gcc 4.x though. So again: seems like a clang bug. Assembler labels and computed gotos are not required in Felix, however they improve performance by replacing a switch on an integer with a computed goto. The choice is made by a MACRO based on configuration data. Coroutines are a very low level features based on an exchange jump function which in turn is based on an extreme low level feature: Felix level label addressing and computed gotos. Fthread based lightweight threads do not use these Felix features but ALL procedures use C++ computed gotos for resumptions instead of a switch if available. The main difference is that the procedures take the address locally (although they STILL use assembler labels to do it). -- john skaller skal...@users.sourceforge.net http://felix-lang.org ------------------------------------------------------------------------------ _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language