2008/5/24 Thiemo Seufer <ths@networkno.de>:
Neil Jerram wrote:
>
> I believe those definitions came from the Boehm GC library.  Do you happen
> to know whether similar improvements have already been applied to Boehm GC?

The development version of Boehm GC carries a subset of it since:
http://bdwgc.cvs.sourceforge.net/bdwgc/bdwgc/include/private/gcconfig.h?r1=1.28&r2=1.29

This might be enough to make it work, altough I believe my patch is
preferable.

OK thanks; I will commit your patch upstream (Guile).  Will you take care of pushing to Boehm GC, if you want to do that?

> So is it the case that the stack actually grows down on mips (and mipsel and
> powerpc)?

Yes. (This is the the case for almost all machines nowdays.)

> Did you see (or work out) exactly how gcc was outsmarting the
> test?

No, I only concluded this from the test's incorrect result.

My guess is that unsigned long is only 32-bit, and so truncation of a 64-bit pointer invalidates the comparison.  Would that make sense?

Google codesearch indicates that other projects use char and char * in this kind of detection code.  Therefore, if you wouldn't mind trying it out, it would be interesting to see if the attached patch will also fix this.  (I'm afraid I currently can't reproduce the seg fault on my own 64-bit test machines.)

Regards,
        Neil