[arm] Tweak C++ guard variables

Mark Mitchell mark@codesourcery.com
Fri Jun 25 10:54:00 GMT 2004


Paul Brook wrote:

>The patch below changes guard variables for static one-time construction in 
>line with the arm c++ eabi.
>It consists of two changes:
>- The guard variable is a (32-bit) int, not long long.
>- It sets/tests the least significant bit, rather than the first byte.
>
>Technically the g++ and libstdc++ changes are independent because the compiler 
>doesn't use the helper function, but it makes sense to keep them in sync.
>
>I've enabled the changes unconditionally (on arm targets). I'm not sure if 
>this is desirable, or if they should only be enables when an eabi based abi 
>is used.
>  
>
I think they should only be used when the EABI is enabled so that ARM 
GNU/Linux (for example) doesn't see an ABI change.

These two functions need comments:

>+static tree
>+arm_cxx_guard_type (void)
>+{
>+  return integer_type_node;
>+}
>+
>+static bool
>+arm_cxx_guard_mask_bit (void)
>+{
>+  return TRUE;
>+}
>  
>
>Index: libstdc++-v3/libsupc++/cxxabi.h
>===================================================================
>RCS file: /var/cvsroot/gcc-cvs/gcc/libstdc++-v3/libsupc++/cxxabi.h,v
>retrieving revision 1.16
>diff -u -p -r1.16 cxxabi.h
>--- libstdc++-v3/libsupc++/cxxabi.h	22 May 2004 21:07:28 -0000	1.16
>+++ libstdc++-v3/libsupc++/cxxabi.h	24 Jun 2004 14:32:52 -0000
>@@ -44,6 +44,11 @@
> 
> #include <stddef.h>
>  
>+/* ??? We should probably define this in the compiler.  */
>  
>
Yes, we should, but this is probably OK for now.

OK with those changes.

Thanks,

-- 
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com



More information about the Gcc-patches mailing list