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: 3.0.1 PATCH: Avoid non-PIC code in boehm-gc for Solaris 2/Intel


On Tue, Jun 26, 2001 at 02:30:08PM +0200, Rainer Orth wrote:
> -	  asm("pushl %eax");  asm("call GC_push_one"); asm("addl $4,%esp");
> +	  asm("pushl %eax"); GC_push_one (); asm("addl $4,%esp");

This isn't going to work reliably.

Try

#define call_push(REGNAME) \
	{ register word reg __asm__( #REGNAME ); GC_push_one (reg); }

#ifndef __PIC__
        call_push(ebx)
#endif
        call_push(ebp)
        call_push(esi)
        call_push(edi)

Which, incidentally, will work for all x86 targets.  Only the MSVC
variant should remain.  Also note that EAX, EDX, ECX are call-clobbered
and will not contain valid data at this point.



r~


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