This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix problem with late insns in sibcall
- From: Richard Henderson <rth at redhat dot com>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 30 Apr 2003 18:13:52 -0700
- Subject: Re: Fix problem with late insns in sibcall
- References: <10304292203.AA13671@vlsi1.ultra.nyu.edu>
On Tue, Apr 29, 2003 at 06:03:34PM -0400, Richard Kenner wrote:
> procedure
> Shift (Point : in out Point_T)
> is
> procedure
> Shift (Value : in out Natural )
> is
> begin
> Value := Value + 1;
> end;
> begin
> Shift (Point.X);
> end;
I'm a bit confused about the calling conventions here. I would
have expected an in-out parameter to be treated like a reference
type in C++. That is, the bit that gets put into the hard register
is the *address* of the data.
Certainly we have no problem converting
struct Point_T {
int X, Y;
};
void Shift(int &Value)
{
Value += 1;
}
void Shift(Point_T &Point)
{
Shift(Point.X);
}
to use sibcalls. Indeed, the later function compiles to
_Z5ShiftR7Point_T:
jmp _Z5ShiftRi
which is exactly what you'd hope for.
r~