public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/14311] New: builtins for atomic operations needed
@ 2004-02-27  0:39 bkoz at gcc dot gnu dot org
  2004-04-27 19:05 ` [Bug c/14311] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-02-27  0:39 UTC (permalink / raw)
  To: gcc-bugs

See:
http://gcc.gnu.org/ml/libstdc++/2004-02/msg00372.html

Currently, the atomicity.h functions are used by:

%grep "atomicity.h" include/*/*.h | grep include
include/bits/basic_string.h:#include <bits/atomicity.h>
include/bits/ios_base.h:#include <bits/atomicity.h>
include/bits/locale_classes.h:#include <bits/atomicity.h>
include/ext/mt_allocator.h:#include <bits/atomicity.h>
include/ext/pool_allocator.h:#include <bits/atomicity.h>

This includes reference counting in std::string, std::ios_base
callbacks, std::locale::facet and std::locale::_Impl, and in various
allocator classes.

Although considered useful, this implementation has one drawback: on one
popular platform, (x86/linux), switching between atomicity files for
i386 and i486 and above is not compatible. Thus, when using i486 and
above libstdc++, all C++ applications (and thus C++ packages in an os
distribution) have to be compiled for both i386 and i486+. I believe
this has been an issue for Red Hat, Debian, and perhaps BSD.

One way around this would be to make these atomic functions gcc
builtins. These would be different semantics than other gcc builtins,
however, because there could be no fall back to a support library in the
case of failure to use the builtin.

Another would be to not define these functions in headers, and instead
put them into libstdc++.so, version them, and then export them. See the
attached patch, which was discussed in last week's tools conference
call. With this, linux distributions for i386 could use

-- 
           Summary: builtins for atomic operations needed
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bkoz at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14311


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-04-16  2:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-27  0:39 [Bug libstdc++/14311] New: builtins for atomic operations needed bkoz at gcc dot gnu dot org
2004-04-27 19:05 ` [Bug c/14311] " pinskia at gcc dot gnu dot org
2005-04-09  3:09 ` [Bug middle-end/14311] " rth at gcc dot gnu dot org
2005-04-09  7:53 ` pcarlini at suse dot de
2005-04-09  8:10 ` pcarlini at suse dot de
2005-04-11 17:14 ` bkoz at redhat dot com
2005-04-14 23:38 ` cvs-commit at gcc dot gnu dot org
2005-04-16  2:07 ` cvs-commit at gcc dot gnu dot org
2005-04-16  2:08 ` rth at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).