Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Wielaard <mjw@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA/DWARF] Set enum type "flag_enum" and "unsigned" flags at type creation.
Date: Wed, 19 Feb 2014 15:18:00 -0000	[thread overview]
Message-ID: <1392823115.21975.238.camel@bordewijk.wildebeest.org> (raw)
In-Reply-To: <1392820455.21975.235.camel@bordewijk.wildebeest.org>

On Wed, 2014-02-19 at 15:34 +0100, Mark Wielaard wrote:
> Does anything break if you just remove the sign-extension part?
> If not, then you don't have to go through the whole
> update_enumeration_type_from_children. Or do you need that for anything
> else?

So, this patch doesn't show any regressions in the testsuite:

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 54c538a..0b5de99 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -14303,7 +14303,6 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
   LONGEST low, high;
   int low_default_is_valid;
   const char *name;
-  LONGEST negative_mask;
 
   orig_base_type = die_type (die, cu);
   /* If ORIG_BASE_TYPE is a typedef, it will not be TYPE_UNSIGNED,
@@ -14433,13 +14432,6 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
 	}
     }
 
-  negative_mask =
-    (LONGEST) -1 << (TYPE_LENGTH (base_type) * TARGET_CHAR_BIT - 1);
-  if (!TYPE_UNSIGNED (base_type) && (low & negative_mask))
-    low |= negative_mask;
-  if (!TYPE_UNSIGNED (base_type) && (high & negative_mask))
-    high |= negative_mask;
-
   range_type = create_range_type (NULL, orig_base_type, low, high);
 
   /* Mark arrays with dynamic length at least as an array of unspecified


So, my hope is that sign extension hack really isn't needed.
Of course it could be that there is some case where it was really needed
and there just isn't a test case for it. Does anybody know/remember?

Thanks,

Mark


  reply	other threads:[~2014-02-19 15:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-27  8:09 Joel Brobecker
2014-02-10 14:29 ` Joel Brobecker
2014-02-17 20:20 ` Joel Brobecker
2014-02-19 14:34 ` Mark Wielaard
2014-02-19 15:18   ` Mark Wielaard [this message]
2014-02-21  9:21     ` Joel Brobecker
2014-02-25 14:32       ` Mark Wielaard
2014-02-26 18:32     ` Joel Brobecker
2014-02-26 18:58       ` Joel Brobecker
2014-02-27 10:30       ` Mark Wielaard
2014-02-27 11:15         ` Mark Wielaard
2014-02-27 14:29         ` Joel Brobecker
2014-02-26 18:42 ` pushed: " Joel Brobecker

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=1392823115.21975.238.camel@bordewijk.wildebeest.org \
    --to=mjw@redhat.com \
    --cc=brobecker@adacore.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