1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

configure.in: FUNC_UNOPTIMIZED

* configure.in: check if optimize pragma is supported.

* include/ruby/defines.h (FUNC_UNOPTIMIZED): fallback definition.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-12-01 01:05:48 +00:00
parent 586c174922
commit ff113d52f7
3 changed files with 8 additions and 2 deletions

View file

@ -1757,6 +1757,7 @@ if_i386=${universal_binary+[defined __i386__]}
RUBY_FUNC_ATTRIBUTE(stdcall, [], [], ${if_i386})
RUBY_FUNC_ATTRIBUTE(cdecl, [], [], ${if_i386})
RUBY_FUNC_ATTRIBUTE(fastcall, [], [], ${if_i386})
RUBY_FUNC_ATTRIBUTE(optimize("O0"), FUNC_UNOPTIMIZED, rb_cv_func_unoptimized)
RUBY_FUNC_ATTRIBUTE(optimize("-Os","-fomit-frame-pointer"), FUNC_MINIMIZED, rb_cv_func_minimized)
if test "$GCC" = yes; then

View file

@ -244,6 +244,9 @@ void rb_ia64_flushrs(void);
#ifndef FUNC_MINIMIZED
#define FUNC_MINIMIZED(x) x
#endif
#ifndef FUNC_UNOPTIMIZED
#define FUNC_UNOPTIMIZED(x) x
#endif
#ifndef RUBY_ALIAS_FUNCTION_TYPE
#define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) \
FUNC_MINIMIZED(type prot) {return (type)name args;}

View file

@ -12,13 +12,15 @@
* http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1381.pdf
*/
#ifdef __GNUC__
#pragma GCC optimize ("O0")
#ifndef FUNC_UNOPTIMIZED
# define FUNC_UNOPTIMIZED(x) x
#endif
#ifndef HAVE_EXPLICIT_BZERO
/* Similar to bzero(), but have a guarantee not to be eliminated from compiler
optimization. */
FUNC_UNOPTIMIZED(void explicit_bzero(void *b, size_t len));
void
explicit_bzero(void *b, size_t len)
{