Re: Update: [PATCH 5/X] libsanitizer: mid-end: Introduce stack variable handling for HWASAN

2020-11-24 Thread Matthew Malcomson via Gcc-patches
On 24/11/2020 12:30, Hongtao Liu wrote: Hi: I'm learning about this patch, and I see one place that might be slighted improved. + poly_int64 size = (top - bot); + + /* Assert the edge of each variable is aligned to the HWASAN tag granule +size. */ + gcc_assert

Re: Update: [PATCH 5/X] libsanitizer: mid-end: Introduce stack variable handling for HWASAN

2020-11-24 Thread Hongtao Liu via Gcc-patches
Hi: I'm learning about this patch, and I see one place that might be slighted improved. + poly_int64 size = (top - bot); + + /* Assert the edge of each variable is aligned to the HWASAN tag granule +size. */ + gcc_assert (multiple_p (top, HWASAN_TAG_GRANULE_SIZE)); +

Re: Update: [PATCH 5/X] libsanitizer: mid-end: Introduce stack variable handling for HWASAN

2020-11-23 Thread Richard Sandiford via Gcc-patches
Sorry for the earlier OK, was replying to the wrong message… Matthew Malcomson writes: > @@ -1216,6 +1255,24 @@ expand_stack_vars (bool (*pred) (size_t), class > stack_vars_data *data) > { > offset = alloc_stack_frame_space (stack_vars[i].size, alignb); >

Re: Update: [PATCH 5/X] libsanitizer: mid-end: Introduce stack variable handling for HWASAN

2020-11-23 Thread Richard Sandiford via Gcc-patches
Matthew Malcomson writes: > Hi there, > > I was just doing some double-checks and noticed I'd placed the > documentation in the wrong section of tm.texi. The `MEMTAG` hooks were > documented in the `Register Classes` section, so I've now moved it to > the `Misc` section. > > That's the only

Re: Update: [PATCH 5/X] libsanitizer: mid-end: Introduce stack variable handling for HWASAN

2020-11-20 Thread Matthew Malcomson via Gcc-patches
Hi there, I was just doing some double-checks and noticed I'd placed the documentation in the wrong section of tm.texi. The `MEMTAG` hooks were documented in the `Register Classes` section, so I've now moved it to the `Misc` section. That's the only change, Ok for trunk? Matthew

Re: Update: [PATCH 5/X] libsanitizer: mid-end: Introduce stack variable handling for HWASAN

2020-11-19 Thread Richard Sandiford via Gcc-patches
Matthew Malcomson writes: > […] > +/* hwasan_frame_base_init_seq is the sequence of RTL insns that will > initialize > + the hwasan_frame_base_ptr. When the hwasan_frame_base_ptr is requested, > we > + generate this sequence but do not emit it. If the sequence was created it > + is

Update: [PATCH 5/X] libsanitizer: mid-end: Introduce stack variable handling for HWASAN

2020-11-19 Thread Matthew Malcomson via Gcc-patches
Hi there, After offline discussion with Richard I've modified the way in which the initialisation for the hwasan base pointer is emitted. Originally it was getting emitted during `expand_used_vars`, and requiring `handle_builtin_alloca` to register a need for it to be emitted so that