This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: V3 PATCH: __cxa_guard_acquire
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 25 Nov 2002 20:24:58 -0800
- Subject: Re: V3 PATCH: __cxa_guard_acquire
--On Monday, November 25, 2002 05:20:06 PM -0800 Richard Henderson
<rth@redhat.com> wrote:
On Mon, Nov 25, 2002 at 03:10:26PM -0800, Mark Mitchell wrote:
+ /* The ABI requires a 64-bit type. */
+ __extension__ typedef int __guard __attribute__((mode (__DI__)));
Careful. The ABI is written in inordinately ia64 specific language.
*Why* does it want a 64-bit type? Does it really want a pointer type,
but is trying to hack around ia64 ilp32 lossage?
Yes, it really wants a 64-bit type. It wants 8 bits for a flag, and
7 other bytes for use as appropriate on the particular OS; the idea
is that you might hide a mutex in those other 7 bytes. You wouldn't
want to shrink this to 4 bytes on a 32-bit architecture; you want
4 bytes that you can use as the mutex.
I copied the code to get a 64-bit type from GLIBC.
The other logical choice would be "long long"; we can use that instead,
I suppose, if you think that's better.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com