[Mono-devel-list] Alias analysis

Ben Maurer bmaurer at ximian.com
Wed Jan 26 19:00:58 EST 2005


On Thu, 2005-01-27 at 00:44 +0100, Zoltan Varga wrote:
>                                                Hi,
> 
>  Wouldn't be easier to just disable optimizations on variables whose address is
> taken ? It usually happens in unsafe code, and with taking addresses
> of valuetypes.

I like this approach better as well.

Maybe some effort should be made to make the valuetype operations
"smarter" for example in this code:

struct X {
...
}

if (foo) {
    X x = new X (blah);
    // do stuff with x
}

if (bar) {
    X y = new X (baz);
   // do stuff with y
}

We could assign x and y the same stack slot, even though ldarga is
probably executed on both of them.

-- Ben




More information about the Mono-devel-list mailing list