This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: calculate_global_regs_live
- From: Jim Wilson <wilson at specifixinc dot com>
- To: Eric Botcazou <ebotcazou at libertysurf dot fr>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 12 Dec 2003 00:53:34 -0800
- Subject: Re: calculate_global_regs_live
- References: <200312111545.20142.ebotcazou@libertysurf.fr>
Eric Botcazou wrote:
Is it a feature or an oversight that calculate_global_regs_live doesn't clear
the regsets containing the liveness information for each BB before calculing
them again?
In gcc-2.95, I see that life_analysis_1 computes these fields. It
allocates the fields before computing them, so they are always zero.
In gcc-3.0, we now have update_life_info/calculate_global_regs_live, and
update_life_info is now called from multiple places, only one of which
allocates the fields before the call. So some calls could already have
data when we enter.
In gcc-3.1, update_life_info now calls calculate_global_regs_live in a
loop, so it is called multiple times with one update_life_info call.
The calculate_global_regs_live comment you quoted appears, but it seems
to be the same algorithm, so it appears to be just a documentation
improvement.
On mainline, there is code in update_life_info to clear the fields in
question at the end of the loop before calling
calculate_globals_regs_live again. So it appears that someone has
already noticed a similar problem to yours.
Maybe this clearing needs to be done at the top of the loop? We don't
need this for the very first call to update_life_info, but it may not be
worth optimizing that case.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com