[PATCH] Fix PPC atomicity.h

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Sat Nov 25 14:25:00 GMT 2000


Hi,

the appended patch is a big step forward on PPC, the libstdc++ tests now look 
like:

Detailed test results in ./testsuite/20001125-mkcheck.txt
+: pass, -b: build failure, -r: run failure, x: disabled
------------------------------------------------------------------------
static  shared  test
------------------------------------------------------------------------
+       +       17_intro/header_ciso646.cc
+       +       17_intro/header_fstream.cc
+       +       17_intro/header_iomanip.cc
+       +       17_intro/header_ios.cc
+       +       17_intro/header_iosfwd.cc
+       +       17_intro/header_iostream.cc
+       +       17_intro/header_istream.cc
+       +       17_intro/header_ostream.cc
+       +       17_intro/headers.cc
+       +       17_intro/header_sstream.cc
+       +       17_intro/header_streambuf.cc
+       +       18_support/numeric_limits.cc
-b      -b      20_util/auto_ptr.cc
-r      +       21_strings/append.cc
+       +       21_strings/capacity.cc
+       +       21_strings/char_traits.cc
+       +       21_strings/compare.cc
-r      +       21_strings/ctor_copy_dtor.cc
-r      +       21_strings/element_access.cc
+       +       21_strings/find.cc
-r      +       21_strings/insert.cc
+       +       21_strings/inserters_extractors.cc
+       +       21_strings/invariants.cc
+       +       21_strings/nonmember.cc
+       +       21_strings/operations.cc
+       +       21_strings/replace.cc
+       +       21_strings/rfind.cc
-r      +       21_strings/substr.cc
+       +       22_locale/codecvt_char_char.cc
+       +       22_locale/codecvt_unicode_char.cc
+       +       22_locale/codecvt_unicode_wchar_t.cc
+       +       22_locale/codecvt_wchar_t_char.cc
+       +       22_locale/ctor_copy_dtor.cc
+       +       22_locale/ctype.cc
+       +       22_locale/ctype_char_members.cc
+       +       22_locale/ctype_wchar_t_members.cc
+       +       22_locale/facet.cc
+       +       22_locale/global_templates.cc
+       +       22_locale/operators.cc
+       +       22_locale/static_members.cc
-r      +       23_containers/bitset_ctor.cc
+       +       23_containers/bitset_shift.cc
-b      -b      23_containers/map_operators.cc
+       +       23_containers/multiset.cc
-b      -b      23_containers/set_operators.cc
+       +       23_containers/vector_capacity.cc
+       +       23_containers/vector_ctor.cc
-r      +       23_containers/vector_element_access.cc
+       +       23_containers/vector_modifiers.cc
+       +       24_iterators/istreambuf_iterator.cc
+       +       24_iterators/iterator.cc
+       +       25_algorithms/lower_bound.cc
+       +       25_algorithms/min_max.cc
+       +       26_numerics/binary_closure.cc
+       +       26_numerics/buggy_complex.cc
+       +       26_numerics/c_math.cc
+       +       26_numerics/complex_inserters_extractors.cc
+       +       26_numerics/complex_value.cc
+       +       26_numerics/valarray.cc
+       +       27_io/filebuf.cc
-r      -r      27_io/filebuf_members.cc
+       +       27_io/fpos.cc
+       +       27_io/ifstream_members.cc
+       +       27_io/ios_base_callbacks.cc
+       +       27_io/ios_base_members_static.cc
+       +       27_io/ios_ctor.cc
+       +       27_io/ios_manip_basefield.cc
+       +       27_io/ios_manip_fmtflags.cc
-r      +       27_io/ios_members.cc
+       +       27_io/istream.cc
+       +       27_io/istream_extractor_arith.cc
+       +       27_io/istream_extractor_char.cc
+       +       27_io/istream_extractor_other.cc
+       +       27_io/istream_manip.cc
+       +       27_io/istream_seeks.cc
+       +       27_io/istream_sentry.cc
+       +       27_io/istream_unformatted.cc
+       +       27_io/istringstream_members.cc
+       +       27_io/narrow_stream_objects.cc
+       +       27_io/ofstream_members.cc
+       +       27_io/ostream.cc
+       +       27_io/ostream_inserter_arith.cc
+       +       27_io/ostream_inserter_char.cc
+       +       27_io/ostream_inserter_other.cc
+       +       27_io/ostream_manip.cc
+       +       27_io/ostream_seeks.cc
+       +       27_io/ostream_unformatted.cc
+       +       27_io/streambuf.cc
+       +       27_io/stringbuf.cc
+       +       27_io/stringstream.cc
+       +       27_io/wide_stream_objects.cc
+       +       ext/headers.cc

which is a _lot_ better than before. Also the c++ testsuite fails shrinked to 
71 FAILs from ~850!.

BTW, is atomicity.h going to stay in the libstdc++-v3 dir? Or will it be a 
generic GCC header (which seems useful) at some point in time? If it will 
stay under libstdc++-v3, I would prefer to remove everything but 
__exchange_and_add and __atomic_add from it in a subsequent patch.

OK to commit?

Franz.

	* config/cpu/powerpc/bits/atomicity.h: Replace '__ATOMICITY_INLINE'
	with 'inline'.
	(__ex__atomic_add): Add __volatile__ to asm.
	(__atomic_add): Likewise.
	(__compare_and_swap): Likewise.
	(__always_swap): Likewise.
	(__test_and_set): Likewise.



More information about the Libstdc++ mailing list