skip to main content
article
Open Access

Precise flow-insensitive may-alias analysis is NP-hard

Published:01 January 1997Publication History
Skip Abstract Section

Abstract

Determining aliases is one of the foundamental static analysis problems, in part because the precision with which this problem is solved can affect the precision of other analyses such as live variables, available expressions, and constant propagation. Previous work has investigated the complexity of flow-sensitive alias analysis. In this article we show that precise flow-insensitive may-alias analysis is NP-hard given arbitrary levels of pointers and arbitrary pointer dereferencing.

References

  1. ANDERSEN, L. O. 1994. Program analysis and specialization for the C programming language. Ph.D. thesis, DIKU Rep. 94/19, DIKU, Univ. of Copenhagen, Denmark.Google ScholarGoogle Scholar
  2. BURKE, M., CARINI, P., CHOI, J., AND HIND, M. 1994. Flow-insensitive interprocedural alias analysis in the presence of pointers. In Languages and Compilers for Parallel Computing: Proceedings of the 7th International Workshop, K. Pingali, U. Banerjee, D. Galernter, A. Nicolau, and D. Padua, Eds. Lecture Notes in Computer Science, vol. 892. Springer-Verlag, Berlin, 234-250. Google ScholarGoogle Scholar
  3. GAREY, M. AND JOHNSON, D. 1979. Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman. Google ScholarGoogle Scholar
  4. LANDI, W. 1992. Undecidability of static analysis. ACM Lett. Program. Lang. Syst. 1, 4, 323-337. Google ScholarGoogle Scholar
  5. LANDI, W. AND RYDER, B. 1991. Pointer induced aliasing: A problem classification. In the ACM Symposium on Principles of Programming Languages. ACM, New York, 93-103. Google ScholarGoogle Scholar
  6. RAMALINGAM, G. 1994. The undecidability of aliasing. ACM Trans. Program. Lang. Syst. 16, 5, 1467-1471. Google ScholarGoogle Scholar
  7. STEENSGAARD, B. 1996. Points-to analysis in almost linear time. In the ACM Symposium on Principles of Programming Languages. ACM, New York, 32-41. Google ScholarGoogle Scholar

Index Terms

  1. Precise flow-insensitive may-alias analysis is NP-hard

              Recommendations

              Reviews

              Max Hailperin

              Horwitz show a problem to be NP-hard that several researchers have recently attacked with polynomial-time algorithms for generating imprecise solutions . Imprecise solutions here mean those that may err, but only in a conservative direction. For the may-alias problem, the conservative direction of error is to report that a pair of expressions may be aliased that in fact cannot be. Horwitz thereby provides a rational explanation for this existing research focus. The flow-insensitive may-alias problem is to determine, given a set of programming language statements and a pair of expressions, whether there is any sequence of statements from the set that results in the expressions being aliases, that is, references to the same memory location. Horwitz addresses this problem for a simple language of assignment statements with arbitrarily nested pointer dereferencing. The only kind of statement in this language assigns an expression's value to an identifier. There are two kinds of expressions: either the address-of operator applied to an identifier, or zero or more pointer dereference operators applied to an identifier. Horwitz's proof is straightforward, consisting of a simple reduction from the Hamiltonian path problem. The paper concludes with a list of interesting open problems.

              Access critical reviews of Computing literature here

              Become a reviewer for Computing Reviews.

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in

              Full Access

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader