[Soot-list] LocalMustAliasAnalysis inaccuracy

Arie Zilberstein arie.zilberstein at gmail.com
Fri Sep 25 05:18:17 EDT 2009


Hi,

 

I believe there is an inaccuracy in LocalMustAliasAnalysis with respect to
dataflow merges.

The problem is that at a merge point, all merged values receive the same
(new) value number. However, this does not account for different variables
that are merged; only for different merge locations.

 

Here's an example. Consider the following method:

 

private static void merge1() {

           Integer x, y;

           if (Math.random() > 0.5) {

                x = new Integer(1);

                y = new Integer(2);

           } else {

                x = new Integer(3);

                y = new Integer(4);

           }

           System.out.println(x);  /**/

           System.out.println(y);

     }

 

The location that I marked with a comment is a merge point for two separate
variables: x and y. However, the merge logic for LocalMustAliasAnalysis
gives both x and y the same value number.

 

Here's how the maps look at the beginning and end of the merge() method:

 

inMap1: {$r0=4, $r1=UNKNOWN, x=3, y=4}

inMap2: {$r0=2, $r1=UNKNOWN, x=1, y=2}

outMap: {$r0=5, $r1=UNKNOWN, x=5, y=5}

 

So, the algorithm deduces that x and y must alias at the merge location.
Which is the wrong result.

 

Best,

Arie

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20090925/ec0519c8/attachment.html 


More information about the Soot-list mailing list