Re: GTY: Explicitly reject 'string_length' option for (fields in) global variables (was: [PATCH] pch: Fix streaming of strings with embedded null bytes)

2023-07-05 Thread Richard Biener via Gcc-patches
On Wed, Jul 5, 2023 at 9:51 AM Thomas Schwinge wrote: > > Hi! > > On 2022-10-18T18:14:54-0400, Lewis Hyatt via Gcc-patches > wrote: > > [...] add a new > > GTY option "string_length" so that gt_pch_note_object can be informed the > > actual length it ought to use, [...] > > > --- a/gcc/doc/gty.t

GTY: Enhance 'string_length' option documentation (was: 'unsigned int len' field in 'libcpp/include/symtab.h:struct ht_identifier' (was: [PATCH] pch: Fix streaming of strings with embedded null bytes)

2023-07-05 Thread Thomas Schwinge
Hi! On 2023-07-04T15:56:23-0400, Lewis Hyatt via Gcc-patches wrote: > On Tue, Jul 4, 2023 at 11:50 AM Thomas Schwinge > wrote: >> I came across this one here on my way working through another (somewhat >> related) GTY issue. I generally do understand the issue here, but do >> have a question

GTY: Explicitly reject 'string_length' option for (fields in) global variables (was: [PATCH] pch: Fix streaming of strings with embedded null bytes)

2023-07-05 Thread Thomas Schwinge
Hi! On 2022-10-18T18:14:54-0400, Lewis Hyatt via Gcc-patches wrote: > [...] add a new > GTY option "string_length" so that gt_pch_note_object can be informed the > actual length it ought to use, [...] > --- a/gcc/doc/gty.texi > +++ b/gcc/doc/gty.texi > @@ -196,7 +196,26 @@ static GTY((length("r

Re: 'unsigned int len' field in 'libcpp/include/symtab.h:struct ht_identifier' (was: [PATCH] pch: Fix streaming of strings with embedded null bytes)

2023-07-04 Thread Lewis Hyatt via Gcc-patches
On Tue, Jul 4, 2023 at 11:50 AM Thomas Schwinge wrote: > > Hi! > > I came across this one here on my way working through another (somewhat > related) GTY issue. I generally do understand the issue here, but do > have a question about 'unsigned int len' field in > 'libcpp/include/symtab.h:struct h

'unsigned int len' field in 'libcpp/include/symtab.h:struct ht_identifier' (was: [PATCH] pch: Fix streaming of strings with embedded null bytes)

2023-07-04 Thread Thomas Schwinge
Hi! I came across this one here on my way working through another (somewhat related) GTY issue. I generally do understand the issue here, but do have a question about 'unsigned int len' field in 'libcpp/include/symtab.h:struct ht_identifier': On 2022-10-18T18:14:54-0400, Lewis Hyatt via Gcc-patc

Re: [PATCH] pch: Fix streaming of strings with embedded null bytes

2022-10-19 Thread Lewis Hyatt via Gcc-patches
On Wed, Oct 19, 2022 at 8:23 AM Jakub Jelinek wrote: > > On Wed, Oct 19, 2022 at 01:17:02PM +0100, Richard Sandiford wrote: > > Jakub Jelinek writes: > > > On Wed, Oct 19, 2022 at 12:54:11PM +0100, Richard Sandiford via > > > Gcc-patches wrote: > > >> Lewis Hyatt via Gcc-patches writes: > > >>

Re: [PATCH] pch: Fix streaming of strings with embedded null bytes

2022-10-19 Thread Jakub Jelinek via Gcc-patches
On Wed, Oct 19, 2022 at 01:17:02PM +0100, Richard Sandiford wrote: > Jakub Jelinek writes: > > On Wed, Oct 19, 2022 at 12:54:11PM +0100, Richard Sandiford via Gcc-patches > > wrote: > >> Lewis Hyatt via Gcc-patches writes: > >> > When a GTY'ed struct is streamed to PCH, any plain char* pointers

Re: [PATCH] pch: Fix streaming of strings with embedded null bytes

2022-10-19 Thread Richard Sandiford via Gcc-patches
Jakub Jelinek writes: > On Wed, Oct 19, 2022 at 12:54:11PM +0100, Richard Sandiford via Gcc-patches > wrote: >> Lewis Hyatt via Gcc-patches writes: >> > When a GTY'ed struct is streamed to PCH, any plain char* pointers it >> > contains >> > (whether they live in GC-controlled memory or not) wil

Re: [PATCH] pch: Fix streaming of strings with embedded null bytes

2022-10-19 Thread Jakub Jelinek via Gcc-patches
On Wed, Oct 19, 2022 at 12:54:11PM +0100, Richard Sandiford via Gcc-patches wrote: > Lewis Hyatt via Gcc-patches writes: > > When a GTY'ed struct is streamed to PCH, any plain char* pointers it > > contains > > (whether they live in GC-controlled memory or not) will be marked for PCH > > output

Re: [PATCH] pch: Fix streaming of strings with embedded null bytes

2022-10-19 Thread Richard Sandiford via Gcc-patches
Lewis Hyatt via Gcc-patches writes: > When a GTY'ed struct is streamed to PCH, any plain char* pointers it contains > (whether they live in GC-controlled memory or not) will be marked for PCH > output by the routine gt_pch_note_object in ggc-common.cc. This routine > special-cases plain char* stri

[PATCH] pch: Fix streaming of strings with embedded null bytes

2022-10-18 Thread Lewis Hyatt via Gcc-patches
When a GTY'ed struct is streamed to PCH, any plain char* pointers it contains (whether they live in GC-controlled memory or not) will be marked for PCH output by the routine gt_pch_note_object in ggc-common.cc. This routine special-cases plain char* strings, and in particular it uses strlen() to ge