A computer system having a platform with random access memory, a central processing unit, an input/output interface and an operating system, also having one or more input/output means, one or more application programs, and a computer processor executing a computer compiler, a computer implemented method for determining the Maximum Fixed Point solution of an interprocedural bidirectional data flow problem for a computer application program by performing the steps of:
- a. constructing a Program Call Graph of the computer program application, the Program Call Graph having a plurality of Program Call Graph nodes and edges, each Program Call Graph node representing a routine in the computer program application and each Program Call Graph edge connecting two Program Call Graph nodes, a calling Program Call Graph node and a called Program Call Graph node, the Program Call Graph edge having a direction from the calling Program Call Graph node to the called Program Call Graph node;
- b. constructing an intraprocedural representation for each Program Call Graph node, the intraprocedural representation being a flow graph with one or more Intraprocedural Flow Graph nodes, each Intraprocedural Flow Graph node representing a program statement that is able to change a data flow solution, each Intraprocedural Flow Graph having one entry node, one exit node, a call site node for each of zero or more call sites in the routine, and a return point associated with each call site;
- c. in the flow graph in each Program Call Graph node, initializing an entry node value for the entry node and an exit node value for the exit node, the entry node value and the exit node value being interprocedural values that represent an interim fixed point interprocedural solution for the routine represented by the Program Call Graph node;
- d. for each Program Call Graph node in tile Program Call Graph, determining an interim intraprocedural solution by means of a data flow analysis method, the interim intraprocedural solution including a new exit node value at the exit node and a new call site value at each of the call sites, and substituting the new exit node value for the exit node value and the new call site values for the respective call site values;
- e. determining a new interim fixed point interprocedural solution for each of the Program Call Graph nodes in topological order in the Program Call Graph, by interprocedurally propagating the new exit node value from the exit node to the call site return point of each of the calling Program Call Graph nodes calling the Program Call Graph node and interprocedurally propagating the new call site values from the Program Call Graph node call sites to each of the entry nodes of the called Program Call Graph nodes called by the Program Call Graph node;
- and
- f. if any interprocedural values have been modified by the iteration performed by step e, then going to step d;
- otherwise selecting the current interprocedural values as the Maximum Fixed Point interprocedural solution.