This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix sched-ebb.c bug (was Re: [3.3 branch] IA64 bootstrap failure)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jim Wilson <wilson at tuliptree dot org>
- Cc: Vladimir Makarov <vmakarov at redhat dot com>, Bernd Schmidt <bernds at redhat dot com>, "H. J. Lu" <hjl at lucon dot org>, Andreas Schwab <schwab at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 15 Jul 2003 20:17:33 -0400
- Subject: Re: [PATCH] Fix sched-ebb.c bug (was Re: [3.3 branch] IA64 bootstrap failure)
- References: <jeel11t8h2.fsf@sykes.suse.de> <20030708143705.GA13718@lucon.org> <jewuetrs9m.fsf@sykes.suse.de> <3F0B4B72.5080802@tuliptree.org> <20030709152453.GA3682@lucon.org> <20030709163759.GB20507@sunsite.ms.mff.cuni.cz> <20030709233503.GC20507@sunsite.ms.mff.cuni.cz> <1057815303.1019.0.camel@leaf.tuliptree.org> <20030715211255.GS20507@sunsite.ms.mff.cuni.cz> <1058313108.1061.181.camel@leaf.tuliptree.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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