Re: [PATCH] DWARF: make signedness explicit for enumerator const values

2017-01-03 Thread Pierre-Marie de Rodat
On 01/02/2017 06:29 PM, Jakub Jelinek wrote: Just a formatting nit, TYPE_UNSIGNED (type) doesn't need to be wrapped in ()s. No need to repost. Done and committed as r244015. Thank you! -- Pierre-Marie de Rodat

Re: [PATCH] DWARF: make signedness explicit for enumerator const values

2017-01-02 Thread Jakub Jelinek
On Mon, Jan 02, 2017 at 06:24:43PM +0100, Pierre-Marie de Rodat wrote: > --- a/gcc/dwarf2out.c > +++ b/gcc/dwarf2out.c > @@ -20930,6 +20930,11 @@ gen_enumeration_type_die (tree type, dw_die_ref > context_die) > if (ENUM_IS_OPAQUE (type)) > add_AT_flag (type_die,

Re: [PATCH] DWARF: make signedness explicit for enumerator const values

2017-01-02 Thread Pierre-Marie de Rodat
On 12/09/2016 03:06 PM, Jason Merrill wrote: I think it's fine guarded by !dwarf_strict; most consumers should happily ignore it if they don't know what to do with it. Thank you for your feedback! This ultimate patch is much smaller. :-) Still bootstrapped and tested successfuly on

Re: [PATCH] DWARF: make signedness explicit for enumerator const values

2016-12-09 Thread Jason Merrill
On Fri, Dec 9, 2016 at 8:38 AM, Pierre-Marie de Rodat wrote: > On 12/09/2016 02:00 PM, Mark Wielaard wrote: >> >> BTW. I think it should also be possible to simply attach a >> DW_AT_encoding directly to the DW_TAG_enumeration_type. It seems a >> simple oversight that option

Re: [PATCH] DWARF: make signedness explicit for enumerator const values

2016-12-09 Thread Pierre-Marie de Rodat
On 12/09/2016 02:00 PM, Mark Wielaard wrote: BTW. I think it should also be possible to simply attach a DW_AT_encoding directly to the DW_TAG_enumeration_type. It seems a simple oversight that option isn't listed in the current DWARF spec. I filed an issue about it:

Re: [PATCH] DWARF: make signedness explicit for enumerator const values

2016-12-09 Thread Mark Wielaard
On Fri, 2016-12-09 at 12:59 +0100, Pierre-Marie de Rodat wrote: > There seems to be only two legal DWARF alternatives to solve this issue: > one is to add a DW_AT_type attribute to DW_TAG_enumerator_type DIEs to > make it point to a base type that specifies the signedness. The other > is to make

Re: [PATCH] DWARF: make signedness explicit for enumerator const values

2016-12-09 Thread Pierre-Marie de Rodat
On 11/18/2016 06:22 PM, Pierre-Marie de Rodat wrote: I agree with you, so I’ll revise to instead add a DW_AT_type attribute to enumeration DIEs to point to a base type. Here is the patch to implement this. Bootstrapped and regtested (GCC’s testsuite) successfuly on x86_64-linux. However, it

Re: [PATCH] DWARF: make signedness explicit for enumerator const values

2016-11-18 Thread Pierre-Marie de Rodat
On 11/14/2016 01:05 PM, Mark Wielaard wrote: You can either choose a signed/unsigned form not giving the consumer a hint about the size of the underlying constant value or one of the sized data forms that don't give a hint about the value representation/signedness. So in both cases the consumer

Re: [PATCH] DWARF: make signedness explicit for enumerator const values

2016-11-14 Thread Mark Wielaard
On Mon, 2016-11-14 at 12:08 +0100, Pierre-Marie de Rodat wrote: > Thank you for your answer! > > On 11/10/2016 01:38 PM, Mark Wielaard wrote: > > IMHO having an explicit DW_AT_type pointing at the base type with size > > and encoding for the DW_TAG_enumerator_type is better for consumers than > >

Re: [PATCH] DWARF: make signedness explicit for enumerator const values

2016-11-14 Thread Pierre-Marie de Rodat
Mark, Thank you for your answer! On 11/10/2016 01:38 PM, Mark Wielaard wrote: IMHO having an explicit DW_AT_type pointing at the base type with size and encoding for the DW_TAG_enumerator_type is better for consumers than having to try and interpret the DW_FORM used to encode the values. I’m

Re: [PATCH] DWARF: make signedness explicit for enumerator const values

2016-11-10 Thread Mark Wielaard
On Thu, 2016-10-13 at 18:12 +0200, Pierre-Marie de Rodat wrote: > Currently, the DWARF description does not specify the signedness of the > representation of enumeration types. This is a problem in some > contexts where DWARF consumers need to determine if value X is greater > than value Y. > >

[PING, PATCH] DWARF: make signedness explicit for enumerator const values

2016-11-08 Thread Pierre-Marie de Rodat
Hello, Ping for the patch submitted there: . Thank you in advance! -- Pierre-Marie de Rodat

[PATCH] DWARF: make signedness explicit for enumerator const values

2016-10-13 Thread Pierre-Marie de Rodat
Hello, Currently, the DWARF description does not specify the signedness of the representation of enumeration types. This is a problem in some contexts where DWARF consumers need to determine if value X is greater than value Y. For instance in Ada: type Enum_Type is ( A, B, C, D); for