This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
RE: 3.0.1 PATCH: Avoid non-PIC code in boehm-gc for Solaris 2/Intel
- To: "'Richard Henderson'" <rth at redhat dot com>, Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- Subject: RE: 3.0.1 PATCH: Avoid non-PIC code in boehm-gc for Solaris 2/Intel
- From: "Boehm, Hans" <hans_boehm at hp dot com>
- Date: Tue, 26 Jun 2001 13:36:26 -0700
- Cc: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org, "Hans-J. Boehm" <boehm at acm dot org>
I'd like this code to remain compilable with non-gcc compilers, to the
extent it was so far. How about using Richard's solution in an ifdef
__GNUC__ ? This would completely replace the existing code for
Linux/xBSD/HURD/ELF and any other platforms for which gcc is basically the
only compiler. Thus I think the code would shrink eventhough there are now
2 variants on some platforms.
Hans
> -----Original Message-----
> From: Richard Henderson [mailto:rth@redhat.com]
> Sent: Tuesday, June 26, 2001 10:28 AM
> To: Rainer Orth
> Cc: gcc-patches@gcc.gnu.org; java-patches@gcc.gnu.org; Hans-J. Boehm
> Subject: 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~
>