This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: vax call pattern updates


On Sun, Jan 14, 2001 at 11:58:07AM -0800, Michael Sokolov wrote:
> If your newly added call and call_value patterns give GCC's optimiser
> a license to use them whenever it feels like it ...

Incorrect.  RETURN_POPS_ARGS tells the middle end how much is going
to be popped.  If this value is non-zero, then call_pop *will* be
generated.

What we want to avoid by having "call" in addition to "call_pop" is
to avoid degenerate RTL of the form

	[(call (mem (symbol_ref "abort"))
	       (const_int 0))
	 (set (reg 14) (plus (reg 14) (const_int 0)))]

or 

	[(call (mem (symbol_ref "abort"))
	       (const_int 0))
	 (set (reg 14) (reg 14))]

as existed before.

Also consider a function like

  void foo()
  {
    bar(0, 1, 2, 3, ..., 255, 256);
  }

Since bar has more than 255 arguments, we cannot encode how many
words to pop, and so we have to use "calls $0,bar".  The old code
would emit the stack adjustment as a part of the call_pop pattern.
However, this is unnecessary because the immediately following
return instruction would take care of the stack adjustment.  The
new code forces the middle end to emit the stack adjust into the
RTL explicitly, at which point it gets optimized away.


r~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]