Precise Call Graphs for C Programs with Function Pointers

  • Authors:
  • Ana Milanova;Atanas Rountev;Barbara G. Ryder

  • Affiliations:
  • Department of Computer Science, Rensselaer Polytechnic Institute. milanova@cs.rpi.edu;Department of Computer and Information Science, The Ohio State University. rountev@cis.ohio-state.edu;Division of Computer and Information Sciences, Rutgers University. ryder@cs.rutgers.edu

  • Venue:
  • Automated Software Engineering
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

The use of pointers presents serious problems for software productivity tools for software understanding, restructuring, and testing. Pointers enable indirect memory accesses through pointer dereferences, as well as indirect procedure calls (e.g., through function pointers in C). Such indirect accesses and calls can be disambiguated with pointer analysis. In this paper we evaluate the precision of one specific pointer analysis (the FA pointer analysis by Zhang et al.) for the purposes of call graph construction for C programs with function pointers. The analysis is incorporated in a production-strength code-browsing tool from Siemens Corporate Research in which the program call graph is used as a primary tool for code understanding.The FA pointer analysis uses an inexpensive, almost-linear, flow- and context-insensitive algorithm. To measure analysis precision, we compare the call graph constructed by this analysis with the most precise call graph obtainable by a large category of existing pointer analyses. Surprisingly, for all our data programs the FA analysis achieves the best possible precision. This result indicates that for the purposes of call graph construction, inexpensive pointer analyses may provide precision comparable to the precision of expensive pointer analyses.