Re: [PATCH] Fix early debug regression with DW_AT_string_length (PR debug/71906)

2016-08-15 Thread Jakub Jelinek
On Fri, Aug 12, 2016 at 07:57:42PM +0200, Jakub Jelinek wrote: > On Fri, Aug 12, 2016 at 01:47:14PM -0400, Jason Merrill wrote: > > On 07/21/2016 12:53 PM, Jakub Jelinek wrote: > > > size = int_size_in_bytes (TREE_TYPE (szdecl)); > > ... > > >+ if (size != DWARF2_ADDR_SIZE)

Re: [PATCH] Fix early debug regression with DW_AT_string_length (PR debug/71906)

2016-08-12 Thread Jakub Jelinek
On Fri, Aug 12, 2016 at 01:47:14PM -0400, Jason Merrill wrote: > On 07/21/2016 12:53 PM, Jakub Jelinek wrote: > > size = int_size_in_bytes (TREE_TYPE (szdecl)); > ... > >+ if (size != DWARF2_ADDR_SIZE) > >+ add_AT_unsigned (array_die, DW_AT_byte_size, size

Re: [PATCH] Fix early debug regression with DW_AT_string_length (PR debug/71906)

2016-08-12 Thread Jason Merrill
On 07/21/2016 12:53 PM, Jakub Jelinek wrote: size = int_size_in_bytes (TREE_TYPE (szdecl)); ... + if (size != DWARF2_ADDR_SIZE) + add_AT_unsigned (array_die, DW_AT_byte_size, size); For DWARF5, where DW_AT_byte_size is always the size of the array t

Re: [PATCH] Fix early debug regression with DW_AT_string_length (PR debug/71906)

2016-08-11 Thread Richard Biener
On Thu, Aug 11, 2016 at 2:36 PM, Jakub Jelinek wrote: > Hi! > > On Wed, Aug 10, 2016 at 12:23:06PM +0200, Richard Biener wrote: >> > Introducing another attribute that does the same thing as existing >> > attribute >> > would be way too ugly. In theory the reference class could be added to >> >

Re: [PATCH] Fix early debug regression with DW_AT_string_length (PR debug/71906)

2016-08-11 Thread Jakub Jelinek
Hi! On Wed, Aug 10, 2016 at 12:23:06PM +0200, Richard Biener wrote: > > Introducing another attribute that does the same thing as existing attribute > > would be way too ugly. In theory the reference class could be added to > > DW_AT_string_length, I can ask on DWARF workgroup (but it might be to

Re: [PATCH] Fix early debug regression with DW_AT_string_length (PR debug/71906)

2016-08-10 Thread Richard Biener
On Wed, Aug 10, 2016 at 10:16 AM, Jakub Jelinek wrote: > On Tue, Aug 09, 2016 at 07:10:34PM +0200, Richard Biener wrote: >> >In some cases like location of file scope vars, or this >> >DW_AT_string_length, >> >you really need to adjust late the debug info created early, there is >> >no >> >workaro

Re: [PATCH] Fix early debug regression with DW_AT_string_length (PR debug/71906)

2016-08-10 Thread Jakub Jelinek
On Tue, Aug 09, 2016 at 07:10:34PM +0200, Richard Biener wrote: > >In some cases like location of file scope vars, or this > >DW_AT_string_length, > >you really need to adjust late the debug info created early, there is > >no > >workaround for that. > > I suppose the workaround is to fix/extend DW

Re: [PATCH] Fix early debug regression with DW_AT_string_length (PR debug/71906)

2016-08-09 Thread Richard Biener
On August 9, 2016 4:36:24 PM GMT+02:00, Jakub Jelinek wrote: >On Mon, Aug 01, 2016 at 12:44:30PM +0200, Richard Biener wrote: >> Note that reading the dwarf standard, it looks like it accepts a >location >> which means we could do an implicit location description using >> DW_OP_stack_value which g

Re: [PATCH] Fix early debug regression with DW_AT_string_length (PR debug/71906)

2016-08-09 Thread Jakub Jelinek
On Mon, Aug 01, 2016 at 12:44:30PM +0200, Richard Biener wrote: > Note that reading the dwarf standard, it looks like it accepts a location > which means we could do an implicit location description using > DW_OP_stack_value which gives us access to arbitrary dwarf > expressions (and thus the possi

Re: [PATCH] Fix early debug regression with DW_AT_string_length (PR debug/71906)

2016-08-01 Thread Richard Biener
On Fri, Jul 22, 2016 at 2:39 PM, Richard Biener wrote: > On Fri, Jul 22, 2016 at 2:08 PM, Jakub Jelinek wrote: >> On Fri, Jul 22, 2016 at 01:55:22PM +0200, Richard Biener wrote: >>> > @@ -19201,18 +19205,70 @@ gen_array_type_die (tree type, dw_die_re >>> >if (size >= 0) >>> > add_

Re: [PATCH] Fix early debug regression with DW_AT_string_length (PR debug/71906)

2016-07-22 Thread Richard Biener
On Fri, Jul 22, 2016 at 2:08 PM, Jakub Jelinek wrote: > On Fri, Jul 22, 2016 at 01:55:22PM +0200, Richard Biener wrote: >> > @@ -19201,18 +19205,70 @@ gen_array_type_die (tree type, dw_die_re >> >if (size >= 0) >> > add_AT_unsigned (array_die, DW_AT_byte_size, size); >> >el

Re: [PATCH] Fix early debug regression with DW_AT_string_length (PR debug/71906)

2016-07-22 Thread Jakub Jelinek
On Fri, Jul 22, 2016 at 01:55:22PM +0200, Richard Biener wrote: > > @@ -19201,18 +19205,70 @@ gen_array_type_die (tree type, dw_die_re > >if (size >= 0) > > add_AT_unsigned (array_die, DW_AT_byte_size, size); > >else if (TYPE_DOMAIN (type) != NULL_TREE > > - &&

Re: [PATCH] Fix early debug regression with DW_AT_string_length (PR debug/71906)

2016-07-22 Thread Richard Biener
On Thu, Jul 21, 2016 at 6:53 PM, Jakub Jelinek wrote: > Hi! > > The early debug changes broke e.g. following testcase: > program pr71906 > character(len=8) :: vard > character(len=:), allocatable :: vare > type t > character(len=:), allocatable :: f > end type > type(t) :: varf > a