[M3devel] optimizer vs. gc?

Jay K jay.krell at cornell.edu
Tue Nov 23 11:44:01 CET 2010


so.."the literate" (actually posts to usenet
by people who worked on Modula-3 compilers!)
warns about the following sort of thing:

void F1(char* a, char* b)
{
 int c;
 for (c = 10; c < 20; ++c)
 {
   a[c] = b[c];
 }
}

getting transformed into something like:

void F1(char* a, char* b)
{
 int c;
 a += 10;
 b += 10;
 for (c = 0; c < 10; ++c)
 {
   a[c] = a[c];
 }
}


actually it warns about something trickier, but this
is the best I can come up with that I understand,
off the top of my head.


 => "interior pointers"
 => "no gc roots in registers or on stack"
 
 
Should we be concerned?
Does our GC handle this?


Should we, like, mark all stores volatile but not all loads?
And maybe all parameters???
  And maybe copy them into non-volatile locals?
  
The trickier warning is something where
the difference of the array bases is what is in registers, not merely an interior pointer.
I searched a while but couldn't find it.
It is probably by David Chase.

 - Jay





 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20101123/af5a645d/attachment-0001.html>


More information about the M3devel mailing list