зеркало из https://github.com/github/ruby.git
undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P on GCC 4.8
GCC 4.8 with optimization causes error if it compiles following code. [Bug #14221] ```c __builtin_choose_expr(__builtin_constant_p(b),0,1) ``` https://github.com/ruby/ruby/pull/1778 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
0c8e6ae0b8
Коммит
98bddfefc1
|
@ -72,6 +72,17 @@ extern "C" {
|
||||||
# define GCC_VERSION_SINCE(major, minor, patchlevel) 0
|
# define GCC_VERSION_SINCE(major, minor, patchlevel) 0
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef GCC_VERSION_BEFORE
|
||||||
|
# if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
|
||||||
|
# define GCC_VERSION_BEFORE(major, minor, patchlevel) \
|
||||||
|
((__GNUC__ < (major)) || \
|
||||||
|
((__GNUC__ == (major) && \
|
||||||
|
((__GNUC_MINOR__ < (minor)) || \
|
||||||
|
(__GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ <= (patchlevel))))))
|
||||||
|
# else
|
||||||
|
# define GCC_VERSION_BEFORE(major, minor, patchlevel) 0
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* likely */
|
/* likely */
|
||||||
#if __GNUC__ >= 3
|
#if __GNUC__ >= 3
|
||||||
|
|
|
@ -26,15 +26,17 @@ extern "C" {
|
||||||
#include RUBY_EXTCONF_H
|
#include RUBY_EXTCONF_H
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "defines.h"
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
/* __builtin_choose_expr and __builtin_types_compatible aren't available
|
/* __builtin_choose_expr and __builtin_types_compatible aren't available
|
||||||
* on C++. See https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */
|
* on C++. See https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */
|
||||||
# undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
|
# undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
|
||||||
# undef HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P
|
# undef HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P
|
||||||
|
#elif GCC_VERSION_BEFORE(4,8,6) /* Bug #14221 */
|
||||||
|
# undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "defines.h"
|
|
||||||
|
|
||||||
#ifndef ASSUME
|
#ifndef ASSUME
|
||||||
# ifdef UNREACHABLE
|
# ifdef UNREACHABLE
|
||||||
# define ASSUME(x) (RB_LIKELY(!!(x)) ? (void)0 : UNREACHABLE)
|
# define ASSUME(x) (RB_LIKELY(!!(x)) ? (void)0 : UNREACHABLE)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче