This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: CAN_ELIMINATE question
- From: Denis Chertykov <denisc at overta dot ru>
- To: Denis Chertykov <denisc at overta dot ru>
- Cc: Ian Lance Taylor <ian at airs dot com>, Eric Christopher <echristo at apple dot com>, gcc at gcc dot gnu dot org
- Date: 28 Mar 2006 22:54:41 +0400
- Subject: Re: CAN_ELIMINATE question
- References: <auto-000033752440@overta.ru> <93106CFF-7969-45F5-B56B-70CFBBBEAD83@apple.com> <lkwfgjni.fsf@overta.ru> <m3accsuqtc.fsf@gossamer.airs.com> <k6bvfbw7.fsf@overta.ru> <m38xsaeu2y.fsf@gossamer.airs.com> <zmkpyirw.fsf@overta.ru>
Denis Chertykov <denisc@overta.ru> writes:
> Ian Lance Taylor <ian@airs.com> writes:
>
> > Denis Chertykov <denisc@overta.ru> writes:
> >
> > > > > I think that better to call update_eliminables() somewhere after
> > > > > setup_save_areas()
> > > >
> > > > Exactly. We do that. About 15 lines after the lines you quoted
> > > > above.
> > > >
> > > > What am I missing?
> > >
> > > I'm (exactly AVR port) need in call to update_eliminables() somewhere
> > > between setup_save_areas() and calculate_needs_all_insns()
> > > (Not "about 15 lines after" ;) because all bad things happened inside
> > > calculate_needs_all_insns().
> > >
> > > calculate_needs_all_insns() collect wrong reloads because
> > > reg_eliminate structure for FP->SP have wrong can_eliminate field.
> >
> > But then we go around the loop again, so everything should get
> > recalculated based on the new assumptions. Doesn't that happen for
> > you?
>
> If you mean the "continue" here:
> if (caller_save_needed)
> setup_save_areas ();
>
> /* If we allocated another stack slot, redo elimination bookkeeping. */
> if (starting_frame_size != get_frame_size ())
> continue;
> -------^^^^^^^^^
> then answer no because only set_initial_elim_offsets() will be called.
> set_initial_elim_offsets() doesn't change reg_eliminate[].can_eliminate
> flag.
>
> If you mean a call update_eliminables() after
> calculate_needs_all_insns() then answer no (again :) because all wrong
> things already happened inside calculate_needs_all_insns() and
> compiler will call
> select_reload_regs() -> find_reload_regs() -> spill_failure()
Can somebody comment the problem, please ?
Denis.