This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 08/18] make side_effects a vec<rtx>
- From: Trevor Saunders <tbsaunde at tbsaunde dot org>
- To: Jeff Law <law at redhat dot com>
- Cc: tbsaunde+gcc at tbsaunde dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 22 Apr 2016 08:11:12 -0400
- Subject: Re: [PATCH 08/18] make side_effects a vec<rtx>
- Authentication-results: sourceware.org; auth=none
- References: <1461133342-10794-1-git-send-email-tbsaunde+gcc at tbsaunde dot org> <1461133342-10794-9-git-send-email-tbsaunde+gcc at tbsaunde dot org> <5719B2D0 dot 2050506 at redhat dot com>
On Thu, Apr 21, 2016 at 11:12:48PM -0600, Jeff Law wrote:
> On 04/20/2016 12:22 AM, tbsaunde+gcc@tbsaunde.org wrote:
> >From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
> >
> >gcc/ChangeLog:
> >
> >2016-04-19 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
> >
> > * var-tracking.c (struct adjust_mem_data): Make side_effects a vector.
> > (adjust_mems): Adjust.
> > (adjust_insn): Likewise.
> > (prepare_call_arguments): Likewise.
> >---
> > gcc/var-tracking.c | 30 +++++++++++-------------------
> > 1 file changed, 11 insertions(+), 19 deletions(-)
> >
> >diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
> >index 9f09d30..7fc6ed3 100644
> >--- a/gcc/var-tracking.c
> >+++ b/gcc/var-tracking.c
> >@@ -926,7 +926,7 @@ struct adjust_mem_data
> > bool store;
> > machine_mode mem_mode;
> > HOST_WIDE_INT stack_adjust;
> >- rtx_expr_list *side_effects;
> >+ auto_vec<rtx> side_effects;
> > };
> Is auto_vec what you really want here? AFAICT this object is never
> destructed, so we're not releasing the memory. Am I missing something here?
it is destructed, auto_vec has a destructor, there for adjust_mem_data
has a destructor since it has a field with a destructor.
adjust_mem_data is always on the stack so the compiler deals with making
sure the destructor is called when it goes out of scope.
Trev
>
>
> Jeff