http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47581

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-02-02 
12:25:01 UTC ---
But then wouldn't be size != 0?

At least when I try -O2 -m32:

int
foo (int x, int y)
{
  long long a = (x + 0LL) * y;
  long long b = (x - 63LL) * ((y | 12) + 67LL);
  long long c = (x - 27LL) * ((y | 17) + 12);
  long long d = (x - 79LL) * ((y | 12) + 18);
  long long e = (x - 28LL) * ((y | 21) + 34LL);
  long long f = (x - 77LL) * ((y | 18) + 39LL);
  return (a >> 10) + (b >> 8) + (c >> 6) + (d >> 24) + (e >> 17) + (f >> 39);
}

size is 0 until IRA time (no stack slots needed) and thus with the patch it
keeps not aligning the offset and then when some pseudos are spilled the
function is called again, at that point already get_frame_size is non-zero and
it allocates bigger stack.  reload iterates as long as
verify_initial_elimination_offsets fails or as long as frame size changes, and
  if (insns_need_reload != 0 || something_needs_elimination
      || something_needs_operands_changed)
    {
      HOST_WIDE_INT old_frame_size = get_frame_size ();

      reload_as_needed (global);

      gcc_assert (old_frame_size == get_frame_size ());

      gcc_assert (verify_initial_elim_offsets ());
    }
should IMHO make sure the patch can work properly (because it only changes
frame offsets if get_frame_size () changed and these asserts assure they don't.

Reply via email to