This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] dwarf2out: Use normal constant values in bound_info if possible.
- From: Cary Coutant <ccoutant at google dot com>
- To: Mark Wielaard <mjw at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Eric Botcazou <ebotcazou at adacore dot com>, Jason Merrill <jason at redhat dot com>
- Date: Tue, 15 Apr 2014 14:24:28 -0700
- Subject: Re: [PATCH] dwarf2out: Use normal constant values in bound_info if possible.
- Authentication-results: sourceware.org; auth=none
- References: <20140323085436 dot GA3372 at toonder dot wildebeest dot org> <1395573309-21016-1-git-send-email-mjw at redhat dot com> <1397511012 dot 5633 dot 53 dot camel at bordewijk dot wildebeest dot org>
> + /* If HOST_WIDE_INT is big enough then represent the bound as
> + a constant value. Note that we need to make sure the type
> + is signed or unsigned. We cannot just add an unsigned
> + constant if the value itself is positive. Some DWARF
> + consumers will lookup the bounds type and then sign extend
> + any unsigned values found for signed types. This is only
> + for DW_AT_lower_bound, normally unsigned values
> + (DW_FORM_data[1248]) are assumed to not need
> + sign-extension. */
This comment confuses me. By "we need to make sure the type is signed
or unsigned" (what else can it be?), I think you mean "we need to
choose a form based on whether the type is signed or unsigned." And by
"This is only for DW_AT_lower_bound, ...", I think you mean "This is
needed only for DW_AT_{lower,upper}_bound, since for most other
attributes, consumers will treat DW_FORM_data[1248] as unsigned
values, regardless of the underlying type."
Otherwise, the patch looks OK to me.
-cary