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] Fix sched-ebb.c bug (was Re: [3.3 branch] IA64 bootstrap failure)


On Tue, Jul 15, 2003 at 04:51:47PM -0700, Jim Wilson wrote:
> Freeing them at cselib_finish_time seems reasonable.  The current code
> incidentally doesn't try to free the values.  Apparently it relies on GC
> to free them but there is no ggc_collect call during sched, so we should
> try to free them ourselves.

So, I guess cselib_finish should call a remove_ routine unconditionally,
not only if there are more than max number of useless ones, and instead
of remove_useless_values should call remove_all_values which would put
all cselib_val's/elt_list's/elt_loc_list's into the empty_* chains,
not just the currently unused ones.
At least when used from sched-deps.c, there will be as many cselib_finish
calls as there are extended basic block in the function till
next ggc_collect.

> > 	* cselib.c (cselib_subst_to_values_1): Renamed from
> > 	cselib_subst_to_values.
> 
> The patch seems reasonable to me if it works.  It is lacking comments
> explaining why we are doing this though.  There should be a comment for
> cselib_subst_to_values saying that it should only be called from outside
> cselib, and there should be a comment pointing out that we can't free
> apparently unused values during cselib if cselib_subst_to_values was
> called, because then we end up with dangling pointers outside cselib.

I'll change this tomorrow.
The patch I've posted bootstrapped and was regression tested,
but I'd appreciate if other people who saw the problem
(H.J.Lu, Andreas Schwab) could check it out if it fixes the bootstrap
failure for them.

	Jakub


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