Journal of Systems Engineering and Electronics ›› 2010, Vol. 32 ›› Issue (3): 614-619.

• 软件、算法与仿真 • 上一篇    下一篇

基于系统依赖图的过程间指针分析方法

王甜甜, 马培军, 苏小红, 郭全萍   

  1. (哈尔滨工业大学计算机科学与技术学院, 黑龙江 哈尔滨 150001)
  • 出版日期:2010-03-18 发布日期:2010-01-03

Interprocedural pointer analysis based on system dependence graph

WANG Tian-tian, MA Pei-jun, SU Xiao-hong, GUO Quan-ping   

  1. (Dept. of Computer Science and Technology, Harbin Inst. of Technology, Harbin 150001, China)
  • Online:2010-03-18 Published:2010-01-03

摘要:

针对目前指针分析算法的程序中间表示形式不能充分表示程序的语法结构与语义,因而不适合应用于源代码-源代码级别的程序转换与分析的问题,提出了一种基于系统依赖图的过程间指针别名分析算法。改进了指针别名信息的表示方法,精确描述数组元素和指针数组元素的别名。以系统依赖图作为程序的中间表示形式,在每个过程调用节点,根据是否为递归调用,分别采用改进的Banning算法和函数内联的方法处理因参数传递引起的别名信息。实验结果表明,该方法的准确性高于Wilson算法和Emami算法,且指针分析结果可直接应用于源代码级别的程序分析与转换中。

Abstract:

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.