From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18219 invoked by alias); 19 Feb 2014 15:18:42 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 18210 invoked by uid 89); 19 Feb 2014 15:18:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Feb 2014 15:18:41 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1JFIb0i019563 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 19 Feb 2014 10:18:37 -0500 Received: from [10.36.116.65] (ovpn-116-65.ams2.redhat.com [10.36.116.65]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s1JFIZc8019433; Wed, 19 Feb 2014 10:18:36 -0500 Subject: Re: [RFA/DWARF] Set enum type "flag_enum" and "unsigned" flags at type creation. From: Mark Wielaard To: Joel Brobecker Cc: gdb-patches@sourceware.org In-Reply-To: <1392820455.21975.235.camel@bordewijk.wildebeest.org> References: <1390796357-3739-1-git-send-email-brobecker@adacore.com> <1392820455.21975.235.camel@bordewijk.wildebeest.org> Content-Type: text/plain; charset="UTF-8" Date: Wed, 19 Feb 2014 15:18:00 -0000 Message-ID: <1392823115.21975.238.camel@bordewijk.wildebeest.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-02/txt/msg00600.txt.bz2 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