Wed Oct 1 22:18:19 2014 UTC ()
Attribute target is not supported by clang, so don't use it.
Explicitly mark this function as non-inline to not defeat the feature
tests.


(joerg)
diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libstdc++-v3/src/c++11/random.cc

cvs diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libstdc++-v3/src/c++11/random.cc (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/libstdc++-v3/src/c++11/random.cc 2014/03/01 08:41:19 1.1.1.1
+++ src/external/gpl3/gcc/dist/libstdc++-v3/src/c++11/random.cc 2014/10/01 22:18:19 1.2
@@ -44,27 +44,30 @@ namespace std _GLIBCXX_VISIBILITY(defaul @@ -44,27 +44,30 @@ namespace std _GLIBCXX_VISIBILITY(defaul
44 { 44 {
45 const char* __nptr = __str.c_str(); 45 const char* __nptr = __str.c_str();
46 char* __endptr; 46 char* __endptr;
47 __ret = std::strtoul(__nptr, &__endptr, 0); 47 __ret = std::strtoul(__nptr, &__endptr, 0);
48 if (*__nptr == '\0' || *__endptr != '\0') 48 if (*__nptr == '\0' || *__endptr != '\0')
49 std::__throw_runtime_error(__N("random_device::_M_strtoul" 49 std::__throw_runtime_error(__N("random_device::_M_strtoul"
50 "(const std::string&)")); 50 "(const std::string&)"));
51 } 51 }
52 return __ret; 52 return __ret;
53 } 53 }
54 54
55#if (defined __i386__ || defined __x86_64__) && defined _GLIBCXX_X86_RDRAND 55#if (defined __i386__ || defined __x86_64__) && defined _GLIBCXX_X86_RDRAND
56 unsigned int 56 unsigned int
 57 __attribute__ ((noinline))
 58# ifndef __clang__
57 __attribute__ ((target("rdrnd"))) 59 __attribute__ ((target("rdrnd")))
 60# endif
58 __x86_rdrand(void) 61 __x86_rdrand(void)
59 { 62 {
60 unsigned int retries = 100; 63 unsigned int retries = 100;
61 unsigned int val; 64 unsigned int val;
62 65
63 while (__builtin_ia32_rdrand32_step(&val) == 0) 66 while (__builtin_ia32_rdrand32_step(&val) == 0)
64 if (--retries == 0) 67 if (--retries == 0)
65 std::__throw_runtime_error(__N("random_device::__x86_rdrand(void)")); 68 std::__throw_runtime_error(__N("random_device::__x86_rdrand(void)"));
66 69
67 return val; 70 return val;
68 } 71 }
69#endif 72#endif
70 } 73 }