re PR libstdc++/54869 (ext/random/simd_fast_mersenne_twister_engine/cons/default.cc FAILs)

2012-10-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/54869
	* include/ext/random (simd_fast_mersenne_twister_engine): Provide
	only for little endian targets.
	* include/ext/random.tcc: Likewise.
	* config/cpu/i486/opt/ext/opt_random.h: Likewise.
	* testsuite/lib/libstdc++.exp (check_v3_target_little_endian): Add.
	* testsuite/lib/dg-options.exp (dg-require-little-endian): Add.
	* testsuite/ext/random/simd_fast_mersenne_twister_engine/
	operators/equal.cc: Use the latter.
	* testsuite/ext/random/simd_fast_mersenne_twister_engine/
	operators/serialize.cc: Likewise.
	* testsuite/ext/random/simd_fast_mersenne_twister_engine/
	operators/inequal.cc: Likewise.
	* testsuite/ext/random/simd_fast_mersenne_twister_engine/
	cons/copy.cc: Likewise.
	* testsuite/ext/random/simd_fast_mersenne_twister_engine/
	cons/seed1.cc: Likewise.
	* testsuite/ext/random/simd_fast_mersenne_twister_engine/
	cons/seed2.cc: Likewise.
	* testsuite/ext/random/simd_fast_mersenne_twister_engine/
	cons/default.cc: Likewise.
	* testsuite/ext/random/simd_fast_mersenne_twister_engine/
	cons/seed_seq.cc: Likewise.

From-SVN: r192256
This commit is contained in:
Paolo Carlini 2012-10-09 14:50:19 +00:00 committed by Paolo Carlini
parent 7b575cfaf3
commit eeeef8f4f9
14 changed files with 111 additions and 8 deletions

View File

@ -1,3 +1,29 @@
2012-10-09 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/54869
* include/ext/random (simd_fast_mersenne_twister_engine): Provide
only for little endian targets.
* include/ext/random.tcc: Likewise.
* config/cpu/i486/opt/ext/opt_random.h: Likewise.
* testsuite/lib/libstdc++.exp (check_v3_target_little_endian): Add.
* testsuite/lib/dg-options.exp (dg-require-little-endian): Add.
* testsuite/ext/random/simd_fast_mersenne_twister_engine/
operators/equal.cc: Use the latter.
* testsuite/ext/random/simd_fast_mersenne_twister_engine/
operators/serialize.cc: Likewise.
* testsuite/ext/random/simd_fast_mersenne_twister_engine/
operators/inequal.cc: Likewise.
* testsuite/ext/random/simd_fast_mersenne_twister_engine/
cons/copy.cc: Likewise.
* testsuite/ext/random/simd_fast_mersenne_twister_engine/
cons/seed1.cc: Likewise.
* testsuite/ext/random/simd_fast_mersenne_twister_engine/
cons/seed2.cc: Likewise.
* testsuite/ext/random/simd_fast_mersenne_twister_engine/
cons/default.cc: Likewise.
* testsuite/ext/random/simd_fast_mersenne_twister_engine/
cons/seed_seq.cc: Likewise.
2012-10-09 Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/54754

View File

@ -32,6 +32,8 @@
#pragma GCC system_header
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#ifdef __SSE2__
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
@ -133,4 +135,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
#endif // __SSE2__
#endif // __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#endif // _EXT_OPT_RANDOM_H

View File

@ -47,6 +47,8 @@ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
/* Mersenne twister implementation optimized for vector operations.
*
* Reference: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/
@ -380,6 +382,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
0x3bd2b64bU, 0x0c64b1e4U>
sfmt216091_64;
#endif // __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
/**
* @brief A beta continuous distribution for random numbers.

View File

@ -37,6 +37,7 @@ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
template<typename _UIntType, size_t __m,
size_t __pos1, size_t __sl1, size_t __sl2,
@ -402,6 +403,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __is;
}
#endif // __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
/**
* Iteration method due to M.D. J<o:>hnk.

View File

@ -1,10 +1,11 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
// { dg-require-little-endian "" }
//
// 2010-02-16 Paolo Carlini <paolo.carlini@oracle.com>
// 2012-08-28 Ulrich Drepper <drepper@gmail.com>, adapted for SFMT
//
// Copyright (C) 2010, 2012 Free Software Foundation, Inc.
// Copyright (C) 2010-2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the

View File

@ -1,10 +1,11 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
// { dg-require-little-endian "" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// 2012-08-28 Ulrich Drepper <drepper@gmail.com>, adapted for SFMT
//
// Copyright (C) 2008, 2009, 2010, 2012 Free Software Foundation, Inc.
// Copyright (C) 2008-2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the

View File

@ -1,10 +1,11 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
// { dg-require-little-endian "" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// 2012-08-28 Ulrich Drepper <drepper@gmail.com>, adapted for SFMT
//
// Copyright (C) 2008, 2009, 2010, 2012 Free Software Foundation, Inc.
// Copyright (C) 2008-2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the

View File

@ -1,10 +1,11 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
// { dg-require-little-endian "" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// 2012-08-28 Ulrich Drepper <drepper@gmail.com>, adapted for SFMT
//
// Copyright (C) 2008, 2009, 2010, 2012 Free Software Foundation, Inc.
// Copyright (C) 2008-2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the

View File

@ -1,10 +1,11 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
// { dg-require-little-endian "" }
//
// 2010-02-01 Paolo Carlini <paolo.carlini@oracle.com>
// 2012-08-28 Ulrich Drepper <drepper@gmail.com>, adapted for SFMT
//
// Copyright (C) 2010, 2012 Free Software Foundation, Inc.
// Copyright (C) 2010-2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the

View File

@ -1,10 +1,11 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
// { dg-require-little-endian "" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// 2012-08-28 Ulrich Drepper <drepper@gmail.com>, adapted for SFMT
//
// Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc.
// Copyright (C) 2008-2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the

View File

@ -1,10 +1,11 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
// { dg-require-little-endian "" }
//
// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
// 2012-08-28 Ulrich Drepper <drepper@gmail.com>, adapted for SFMT
//
// Copyright (C) 2010, 2012 Free Software Foundation, Inc.
// Copyright (C) 2010-2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the

View File

@ -1,10 +1,11 @@
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
// { dg-require-little-endian "" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// 2012-08-28 Ulrich Drepper <drepper@gmail.com>, adapted for SFMT
//
// Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
// Copyright (C) 2008-2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the

View File

@ -206,6 +206,15 @@ proc dg-require-static-libstdcxx { args } {
return
}
proc dg-require-little-endian { args } {
if { ![ check_v3_target_little_endian ] } {
upvar dg-do-what dg-do-what
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
return
}
return
}
proc add_options_for_no_pch { flags } {
# This forces any generated and possibly included PCH to be invalid.
return "-D__GLIBCXX__=99999999"

View File

@ -1736,6 +1736,57 @@ proc check_v3_target_static_libstdcxx { } {
return $et_static_libstdcxx
}
proc check_v3_target_little_endian { } {
global cxxflags
global DEFAULT_CXXFLAGS
global et_little_endian
global tool
if { ![info exists et_little_endian_target_name] } {
set et_little_endian_target_name ""
}
# If the target has changed since we set the cached value, clear it.
set current_target [current_target_name]
if { $current_target != $et_little_endian_target_name } {
verbose "check_v3_target_little_endian: `$et_little_endian_target_name'" 2
set et_little_endian_target_name $current_target
if [info exists et_little_endian] {
verbose "check_v3_target_little_endian: removing cached result" 2
unset et_little_endian
}
}
if [info exists et_little_endian] {
verbose "check_v3_target_little_endian: using cached result" 2
} else {
set et_little_endian 0
set src little_endian[pid].cc
set f [open $src "w"]
puts $f "#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__"
puts $f "# error Not little endian"
puts $f "#endif"
close $f
set cxxflags_saved $cxxflags
set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
set lines [v3_target_compile $src /dev/null preprocess ""]
set cxxflags $cxxflags_saved
file delete $src
if [string match "" $lines] {
# No error message, preprocessing succeeded.
set et_little_endian 1
} else {
verbose "check_v3_target_little_endian: compilation failed" 2
}
}
verbose "check_v3_target_little_endian: $et_little_endian" 2
return $et_little_endian
}
set additional_prunes ""