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]
Other format: [Raw text]

Re: [PATCH] 3rd try: Add sseregparm function attribute for x86


Richard Henderson wrote:
> On Thu, Jun 09, 2005 at 11:22:44PM +0200, Richard Guenther wrote:
> 
>>!               error ("fastcall and stdcall attributes are not compatible");
> 
> 
> I don't think you should remove this.  This behaviour comes from 
> Windows compilers.

I don't know if this combination actually works - though it is not
incompatible in principle.  Consider

void foo(int, int, float);

we'd pass both integer arguments in registers and the float on
the stack, which would then be popped in foo.

> Otherwise I'd like to see tests, as Joseph asks.

I'll try to do runtime -O0 tests like

void __attribute__((fastcall, stdcall)) foo(int i, int j, float x)
{
}

int main()
{
  int i=0, j=0;
  float x=1.0;
  foo(i,j,x);
  if (x != 1.0)
    abort();
}

will this fail if the stack is not adjusted correctly?  Do you have
better suggestions for a runtime check?

Thanks,
Richard.


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