[M3devel] maybe volatile is "good"?

Tony Hosking hosking at cs.purdue.edu
Wed Jun 9 14:13:21 CEST 2010


This is not a problem.   gcc doesn't perform these optimisations, as far as I know.

On 9 Jun 2010, at 03:07, Jay K wrote:

> 
> 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