Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Doug Evans" <dje@google.com>
To: "GDB Patches" <gdb-patches@sourceware.org>
Subject: Re: [RFA] small size reduction to struct die_info
Date: Mon, 15 Sep 2008 02:50:00 -0000	[thread overview]
Message-ID: <e394668d0809141949n9364d27ue0696ab11cfcf83e@mail.gmail.com> (raw)
In-Reply-To: <20080914022132.GA24834@caradoc.them.org>

On Sat, Sep 13, 2008 at 7:21 PM, Daniel Jacobowitz <drow@false.org> wrote:
> On Sat, Sep 13, 2008 at 06:25:36PM -0700, Doug Evans wrote:
>> This reduces the size of struct die_info for 32 bit hosts.
>>
>> Ok to check in?
>>
>> 2008-09-13  Doug Evans  <dje@sebabeach.org>
>>
>>         * dwarf2read.c (struct die_info): Make members tag, num_attrs 16 bits.
>
> OK, though I wonder if GCC generates better code for short than int :
> 16?

There's no difference in generated code. I went with short just in
case some other compiler had issues.

This patch does the same thing for structs attr_abbrev, attribute.  Ok
to check in?

2008-09-14  Doug Evans  <dje@sebabeach.org>

        * dwarf2read.c (struct abbrev_info): Make members name, form 16 bits.
        (struct attribute): Ditto.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.282
diff -u -p -r1.282 dwarf2read.c
--- dwarf2read.c        15 Sep 2008 01:22:02 -0000      1.282
+++ dwarf2read.c        15 Sep 2008 02:19:52 -0000
@@ -513,15 +513,15 @@ struct abbrev_info

 struct attr_abbrev
   {
-    enum dwarf_attribute name;
-    enum dwarf_form form;
+    ENUM_BITFIELD(dwarf_attribute) name : 16;
+    ENUM_BITFIELD(dwarf_form) form : 16;
   };

 /* Attributes have a name and a value */
 struct attribute
   {
-    enum dwarf_attribute name;
-    enum dwarf_form form;
+    ENUM_BITFIELD(dwarf_attribute) name : 16;
+    ENUM_BITFIELD(dwarf_form) form : 16;
     union
       {
        char *str;


  reply	other threads:[~2008-09-15  2:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-14  1:26 Doug Evans
2008-09-14  2:22 ` Daniel Jacobowitz
2008-09-15  2:50   ` Doug Evans [this message]
2008-09-15  3:19     ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e394668d0809141949n9364d27ue0696ab11cfcf83e@mail.gmail.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox