ruby-changes:40744
From: nobu <ko1@a...>
Date: Tue, 1 Dec 2015 10:06:02 +0900 (JST)
Subject: [ruby-changes:40744] nobu:r52823 (trunk): configure.in: FUNC_UNOPTIMIZED
nobu 2015-12-01 10:05:48 +0900 (Tue, 01 Dec 2015) New Revision: 52823 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52823 Log: configure.in: FUNC_UNOPTIMIZED * configure.in: check if optimize pragma is supported. * include/ruby/defines.h (FUNC_UNOPTIMIZED): fallback definition. Modified files: trunk/configure.in trunk/include/ruby/defines.h trunk/missing/explicit_bzero.c Index: include/ruby/defines.h =================================================================== --- include/ruby/defines.h (revision 52822) +++ include/ruby/defines.h (revision 52823) @@ -244,6 +244,9 @@ void rb_ia64_flushrs(void); https://github.com/ruby/ruby/blob/trunk/include/ruby/defines.h#L244 #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;} Index: configure.in =================================================================== --- configure.in (revision 52822) +++ configure.in (revision 52823) @@ -1757,6 +1757,7 @@ if_i386=${universal_binary+[defined __i3 https://github.com/ruby/ruby/blob/trunk/configure.in#L1757 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 Index: missing/explicit_bzero.c =================================================================== --- missing/explicit_bzero.c (revision 52822) +++ missing/explicit_bzero.c (revision 52823) @@ -12,13 +12,15 @@ https://github.com/ruby/ruby/blob/trunk/missing/explicit_bzero.c#L12 * 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) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/