<div dir="ltr"><div>It makes IntegerArrayTest green on MacOSX Spur64bits and does not seem to break anything else, so I will commit this evening.<br></div>Linux and Windows which take the other compiler branch are not concerned, as well as 32 bits VM for which the change is transparent.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-11-08 19:10 GMT+01:00 David T. Lewis <span dir="ltr"><<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
On Tue, Nov 08, 2016 at 12:57:26PM -0500, David T. Lewis wrote:<br>
><br>
> On Tue, Nov 08, 2016 at 06:21:04PM +0100, Nicolas Cellier wrote:<br>
> ><br>
> > 2016-11-08 16:08 GMT+01:00 David T. Lewis <<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>>:<br>
> ><br>
> > ><br>
> > > On Tue, Nov 08, 2016 at 03:19:50PM +0100, Nicolas Cellier wrote:<br>
> > > ><br>
> > > > Hi David,<br>
> > > > Sorry, I've no linux/mac vm available currently to exhibit the problem.<br>
> > ><br>
> > > Hi Nicolas,<br>
> > ><br>
> > > I was using this pre-built Spur VM:<br>
> > ><br>
> > > Virtual Machine<br>
> > > ---------------<br>
> > > /usr/local/lib/squeak/5.0-<wbr>201607171247_64/squeak<br>
> > > Croquet Closure Cog[Spur] VM [CoInterpreterPrimitives<br>
> > > VMMaker.oscog-eem.1902]<br>
> > > Unix built on Jul 17 2016 14:02:20 Compiler: 4.6.3<br>
> > > platform sources revision VM: r201607171247 <a href="https://github.com/" rel="noreferrer" target="_blank">https://github.com/</a><br>
> > > OpenSmalltalk/opensmalltalk-<wbr>vm.git $ Date: Sun Jul 17 14:47:17 2016 +0200<br>
> > > $ Plugins: r201607171247 <a href="https://github.com/OpenSmalltalk/opensmalltalk-" rel="noreferrer" target="_blank">https://github.com/<wbr>OpenSmalltalk/opensmalltalk-</a><br>
> > > vm.git $<br>
> > > CoInterpreter VMMaker.oscog-eem.1902 uuid: d5860bb5-b41c-4337-90d4-<wbr>c2abc979248d<br>
> > > Jul 17 2016<br>
> > > StackToRegisterMappingCogit VMMaker.oscog-eem.1902 uuid:<br>
> > > d5860bb5-b41c-4337-90d4-<wbr>c2abc979248d Jul 17 2016<br>
> > ><br>
> > ><br>
> > > Unfortunately I cannot compile Cog/Spur on my Ubuntu PC (build system<br>
> > > issues),<br>
> > > so I cannot be of much help beyond that.<br>
> > ><br>
> > > But just for my own understanding, is it the case that IntegerArray access<br>
> > > does not work for you on a 64 bit image on Windows?<br>
> > ><br>
> > > Note, the #ifdef USE_INLINE_MEMORY_ACCESSORS is very old. I think that Ian<br>
> > > wrote it (Tim might know better). The only memory access code that I wrote<br>
> > > is the Smalltalk (slang) version in the VMMaker repository, but that is<br>
> > > not relevant here.<br>
> > ><br>
> > > Dave<br>
> > ><br>
> > ><br>
> > So this path is forced on macosx 32 & 64 bits via<br>
> > <a href="https://raw.githubusercontent.com/OpenSmalltalk/opensmalltalk-vm/Cog/build.macos64x64/common/Makefile.vm" rel="noreferrer" target="_blank">https://raw.githubusercontent.<wbr>com/OpenSmalltalk/<wbr>opensmalltalk-vm/Cog/build.<wbr>macos64x64/common/Makefile.vm</a><br>
> ><br>
> > DEFS:=    $(COGDEFS) -DUSE_GLOBAL_STRUCT=0 -DNO_ISNAN=1 \<br>
> >         -DUSE_INLINE_MEMORY_ACCESSORS -D'TZ="$(TZ)"' \<br>
> >         $(INTERPFLAGS)<br>
> ><br>
> > Linux does not have it set... That explains the difference, I tested 64bits<br>
> > spur on mac...<br>
> ><br>
><br>
> I compiled a VM with USE_INLINE_MEMORY_ACCESSORS defined, and I still see no<br>
> failures. This is 64-bit image and VM, sizeof(sqInt) is 8 and sizeof(void *)<br>
> is 8. I can only test this with interpreter VM but it should be the same for<br>
> 64-bit Spur.<br>
><br>
> I think that I must be looking at the wrong thing. Do you have a code example<br>
> that fails in your image?<br>
><br>
<br>
</div></div>Before I drag this discussion too far off topic, I should add that I think you<br>
are right about the sign extension issue. I also tried a VM compiled with this,<br>
which also works fine:<br>
<br>
//# define intAtPointer(ptr)            ((sqInt)(*((unsigned int *)(ptr))))<br>
//# define intAtPointerput(ptr, val)    ((sqInt)(*((unsigned int *)(ptr))= (int)(val)))<br>
<span class=""># define intAtPointer(ptr)              ((sqInt)(*((int *)(ptr))))<br>
# define intAtPointerput(ptr, val)      ((sqInt)(*((int *)(ptr))= (int)(val)))<br>
<br>
</span>So your original point seems right to me, I just am having a hard time reproducing<br>
any kind of real error in practice.<br>
<br>
Dave<br>
<br>
</blockquote></div><br></div>