User account creation filtered due to spam.

Bug 42204 - update_eliminables should be called in reload after something changes
Summary: update_eliminables should be called in reload after something changes
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Blocks: 56183
  Show dependency treegraph
Reported: 2009-11-28 02:22 UTC by Andy Hutchinson
Modified: 2013-02-02 15:38 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: avr-unknown-none
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Andy Hutchinson 2009-11-28 02:22:43 UTC
This bug was previously mentioned in email from Denis. I have confirmed this on 4.5 (after long but educational tour of reload)

When stacks slots increase from zero in reload() (in my case due to setup_save_areas() ) the register elimination conditions can change. For example the AVR port has:

get_frame_size () > 0 

as part of frame_pointer_required_p thus FP->SP elimination can change.

New slots do restart the spill and reload loop :

      /* If we allocated another stack slot, redo elimination bookkeeping.  */
      if (starting_frame_size != get_frame_size ())

BUT update_eliminables is never called before calculate_needs_all_insns(), so the wrong reloads are calculated (in my case marking the FP to be spilled in the just added caller save insn !)

As a consequence, a spill and reload failure occurs.

The solution would seem to be to add update_eliminables before calculate_needs_all_insns (global);
Comment 1 Eric Weddington 2010-09-20 02:45:10 UTC
Andy, do you have a test case for this bug?