[M3devel] maybe volatile is "good"?
Jay K
jay.krell at cornell.edu
Wed Jun 9 09:07:18 CEST 2010
A friend was asking about the portability of the system, and the "ptrdiff_t problem" -- where the optimizer might generate code whereby pointers exist but aren't evident in any registers or on the stack, because instead some pointer difference is being applied. I can't describe this well, but I know what he was referring to. A posting by David Chase mentions it. The result is that the garbage collector doesn't realize something is live and prematurely frees it, or moves it and doesn't update references...ok here is the link:
http://compilers.iecc.com/comparch/article/90-08-046
"...Worse things can happen; in some situations, it
may profit to use &a[-100] to reference elements of a, or to use
&b[0]-&a[0] to generate references to b"
So, this makes me nervous about my recent removal of making all loads and stores volatile.
Maybe best to put them back?
I know the optimized codegen was terrible, but..
- Jay
More information about the M3devel
mailing list