针对目前指针分析算法的程序中间表示形式不能充分表示程序的语法结构与语义,因而不适合应用于源代码-源代码级别的程序转换与分析的问题,提出了一种基于系统依赖图的过程间指针别名分析算法。改进了指针别名信息的表示方法,精确描述数组元素和指针数组元素的别名。以系统依赖图作为程序的中间表示形式,在每个过程调用节点,根据是否为递归调用,分别采用改进的Banning算法和函数内联的方法处理因参数传递引起的别名信息。实验结果表明,该方法的准确性高于Wilson算法和Emami算法,且指针分析结果可直接应用于源代码级别的程序分析与转换中。
Existing pointer analysis algorithms usually adopt a lower-level intermediate representation which can not sufficiently represent the syntactical structure and semanteme of programs,which makes them difficult apply to source-to-source program transformation or analysis.To solve this problem,a flow-sensitive and context-sensitive pointer analysis algorithm based on system dependence graph is presented.An improved representation of alias information is proposed to describe the subscript details of elements in arrays,especially in pointer arrays.Then an iterative alias analysis for each procedure is performed on the system dependence graph of the program.An improved Banning algorithm or an inlining method is used to analyze the alias information respectively at each calling node according to a rule whether it's an iterative call.Test results show that the precision of this approach is higher than those of Wilson's and Emami's approaches.The pointer analyzing results can be directly applied to source-to-source program transformation and analysis.