[Soot-list] Why create temp$xx variables?

Peng Du imdupeng at gmail.com
Tue Apr 21 12:29:10 EDT 2009


Thanks, Pat and Erir. 

Probably I have made some confusions in the previous posts. First thing
first, I am a starter on both static program analysis and SOOT. I am
doing a class project using SOOT to create a more precise flow analysis
by the help of Satisfiability Modulo Theory (SMT) solvers. 

The idea is still quite rough and my understanding of SOOT is limited. I
am not targeting a full-fledged constant propagator as provided in SOOT.
I simply want to find the constant "z" in that test program, which as
suggested by Dragon book, is not possible with the ordinary constant
propagation. Given the time constraint for this small project, I would
significantly simply the program to only contain some basic arithmetic
computations.

Thus, what I hope SOOT can output is a shimple like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   public static int foo(boolean)
    {
        boolean flag;
        int x, y, z, x_1, y_1, x_2, y_2;

        flag := @parameter0: boolean;
        if flag == 0 goto label1;

        goto label0;

     label0:        
        x = 2;
        y = 3;
(0)     goto label2;

     label1:
        x_1 = 3;
(1)     y_1 = 2;

     label2:
        x_2 = Phi(x #0, x_1 #1);
        y_2 = Phi(y #0, y_1 #1);
        
        z = x_2 + y_2;
        return z;
    }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Is this possible? BTW, what is the command line for a "default" run of
SOOT? I tried various combinations and turned on those propagator and
folder, but no help at all. SOOT still generated those temp$ variables. 
I think my command line should be wrong. 


Thank you. 


Peng

 


On Tue, 2009-04-21 at 12:11 -0400, Patrick Lam wrote:
> ecause Soot creates them by default when 
> creating Jimple from bytecode; it has to do some work to eliminate
> them. 
> I don't exactly understand what you're trying to accomplish. You can 
> either run your own constant propagator without Soot's default ones,
> and 
> you should then get rid of the temp$ variables and anything else you
> can 
> get, or you can run your constant propagator with Soot's default
> passes, 
> in which case you should be able to get any additional constants that 
> you can find.
> 



More information about the Soot-list mailing list