This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] [c++] Save space in cxx_binding
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 4 Jan 2004 23:43:36 -0500
- Subject: Re: [PATCH] [c++] Save space in cxx_binding
- References: <96850AAA-3F38-11D8-88D8-000393A6D2F2@physics.uc.edu>
On Sun, Jan 04, 2004 at 08:35:28PM -0800, Andrew Pinski wrote:
> In cxx_binding, there are only two bit-fields which should be using a
> CHAR_BITFIELD instead of unsigned which saves memory space.
> Ok? Bootstrapped on powerpc-apple-darwin7.2.0.
Um, how does this save anything? They're still one-bit bitfields.
They don't get any alignment benefit because the struct is aligned to
> * name-lookup.h (cxx_binding): Use CHAR_BITFIELD instead of
> unsigned for bit-fields, value_is_inherited and is_local.
> Index: name-lookup.h
> RCS file: /cvs/gcc/gcc/gcc/cp/name-lookup.h,v
> retrieving revision 1.13
> diff -u -p -r1.13 name-lookup.h
> --- name-lookup.h 2 Dec 2003 10:11:24 -0000 1.13
> +++ name-lookup.h 5 Jan 2004 04:31:03 -0000
> @@ -80,8 +80,8 @@ struct cxx_binding GTY(())
> tree type;
> /* The scope at which this binding was made. */
> cxx_scope *scope;
> - unsigned value_is_inherited : 1;
> - unsigned is_local : 1;
> + CHAR_BITFIELD value_is_inherited : 1;
> + CHAR_BITFIELD is_local : 1;
> extern tree identifier_type_value (tree);
MontaVista Software Debian GNU/Linux Developer