diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-12-19 03:23:24 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-12-19 03:23:24 +0000 |
commit | dba815326696d902598cdee7335379af513941c3 (patch) | |
tree | b94c8bf0e90fe5bc6491370d4e575f0f8d5b3261 /eval.c | |
parent | f511d52438535a3d091e44568b1e05ebb3e26889 (diff) |
* eval.c (FUNCTION_CALL_MAY_RETURN_TWICE): activate only
before gcc 4.0.3 on SPARC and IA64.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -126,7 +126,18 @@ rb_jump_context(env, val) * * Since the magic setjmp is not enough for SPARC, * inline asm is used to prohibit registers in register windows. + * + * Since the problem is fixed at gcc 4.0.3, the magic is applied only for + * prior versions of gcc. + * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21957 + * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22127 */ +#define GCC_VERSION_BEFORE(major, minor, patchlevel) \ + (defined (__GNUC__) && \ + ((__GNUC__ < (major)) || \ + (__GNUC__ == (major) && __GNUC_MINOR__ < (minor)) || \ + (__GNUC__ == (major) && __GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ < (patchlevel)))) +#if GCC_VERSION_BEFORE(4,0,3) #if defined (__GNUC__) && (defined(sparc) || defined(__sparc__)) #define FUNCTION_CALL_MAY_RETURN_TWICE \ ({ __asm__ volatile ("" : : : \ @@ -134,12 +145,19 @@ rb_jump_context(env, val) "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7", \ "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); }) #else +#if defined(__ia64__) static jmp_buf function_call_may_return_twice_jmp_buf; int function_call_may_return_twice_false = 0; #define FUNCTION_CALL_MAY_RETURN_TWICE \ (function_call_may_return_twice_false ? \ setjmp(function_call_may_return_twice_jmp_buf) : \ 0) +#else +#define FUNCTION_CALL_MAY_RETURN_TWICE 0 +#endif +#endif +#else +#define FUNCTION_CALL_MAY_RETURN_TWICE 0 #endif #define ruby_longjmp(env, val) rb_jump_context(env, val) #define ruby_setjmp(j) ((j)->status = 0, \ |