This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 08/18] make side_effects a vec<rtx>


On 04/22/2016 06:11 AM, Trevor Saunders wrote:
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.\
Duh :-)

OK for the trunk. It looks like Bernd and others are handling the bulk of these, so I'll step aside.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]