Skip to main content

Polymorphic versus Monomorphic Flow-Insensitive Points-To Analysis for C

  • Conference paper
Static Analysis (SAS 2000)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1824))

Included in the following conference series:

Abstract

We carry out an experimental analysis for two of the design dimensions of flow-insensitive points-to analysis for C: polymorphic versus monomorphic and equality-based versus inclusion-based. Holding other analysis parameters fixed, we measure the precision of the four design points on a suite of benchmarks of up to 90,000 abstract syntax tree nodes. Our experiments show that the benefit of polymorphism varies significantly with the underlying monomorphic analysis. For our equality-based analysis, adding polymorphism greatly increases precision, while for our inclusion-based analysis, adding polymorphism hardly makes any difference. We also gain some insight into the nature of polymorphism in points-to analysis of C. In particular, we find considerable polymorphism available in function parameters, but little or no polymorphism in function results, and we show how this observation explains our results.

This research was supported in part by the National Science Foundation Young Investigator Award No. CCR-9457812, NASA Contract No. NAG2-1210, an NDSEG fellowship, and an equipment donation from Intel.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aiken, A., Fähndrich, M., Foster, J.S., Su, Z.: A Toolkit for Constructing Type- and Constraint-Based Program Analyses. In: Leroy, X., Ohori, A. (eds.) TIC 1998. LNCS, vol. 1473, pp. 78–96. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  2. Aiken, A., Wimmers, E.L.: Solving Systems of Set Constraints. In: Proceedings, Seventh Annual IEEE Symposium on Logic in Computer Science, Santa Cruz, California, pp. 329–340 (June 1992)

    Google Scholar 

  3. Aiken, A., Wimmers, E.L.: Type Inclusion Constraints and Type Inference. In: FPCA 1993 Conference on Functional Programming Languages and Computer Architecture, Copenhagen, Denmark, pp. 31–41 (June 1993)

    Google Scholar 

  4. Andersen, L.O.: Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, Department of Computer Science, University of Copenhagen (May 1994)

    Google Scholar 

  5. Burke, M., Carini, P., Choi, J.-D., Hind, M.: Flow-Insensitive Interprocedural Alias Analysis in the Presence of Pointers. In: Pingali, K.K., Gelernter, D., Padua, D.A., Banerjee, U., Nicolau, A. (eds.) LCPC 1994. LNCS, vol. 892, pp. 234–250. Springer, Heidelberg (1995)

    Chapter  Google Scholar 

  6. Chatterjee, R., Ryder, B.G., Landi, W.A.: Relevant Context Inference. In: Proceedings of the 26th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, San Antonio, Texas, pp. 133–146 (January 1999)

    Google Scholar 

  7. Das, M.: Unification-based Pointer Analysis with Directional Assignments. In: Proceedings of the 2000 ACM SIGPLAN Conference on Programming Language Design and Implementation, Vancouver B.C., Canada (June 2000) (to appear)

    Google Scholar 

  8. Debray, S., Muth, R., Weippert, M.: Alias Analysis of Executable Code. In: Proceedings of the 25th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, San Diego, California, pp. 12–24 (January 1998)

    Google Scholar 

  9. Deutsch, A.: Interprocedural May-Alias Analysis for Pointers: Beyond k-limiting. In: Proceedings of the 1994 ACM SIGPLAN Conference on Programming Language Design and Implementation, Orlando, Florida, pp. 230–241 (June 1994)

    Google Scholar 

  10. Dor, N., Rodeh, M., Sagiv, M.: Detecting Memory Errors via Static Pointer Analysis. In: Proceedings of the ACM SIGPLAN/SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, Montreal, Canada, June 1998, pp. 27–34 (1998)

    Google Scholar 

  11. Emami, M., Ghiya, R., Hendren, L.J.: Context-Sensitive Interprocedural Pointsto Analysis in the Presence of Function Pointers. In: Proceedings of the 1994 ACM SIGPLAN Conference on Programming Language Design and Implementation, Orlando, Florida, pp. 242–256 (June 1994)

    Google Scholar 

  12. Fähndrich, M.: BANE: A Library for Scalable Constraint-Based Program Analysis. PhD thesis, University of California, Berkeley (1999)

    Google Scholar 

  13. Fähndrich, M., Aiken, A.: Program Analysis using Mixed Term and Set Constraints. In: Van Hentenryck, P. (ed.) SAS 1997. LNCS, vol. 1302, pp. 114–126. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  14. Fähndrich, M., Foster, J.S., Su, Z., Aiken, A.: Partial Online Cycle Elimination in Inclusion Constraint Graphs. In: Proceedings of the 1998 ACM SIGPLAN Conference on Programming Language Design and Implementation, Montreal, Canada, pp. 85–96 (June 1998)

    Google Scholar 

  15. Fähndrich, M., Rehof, J., Das, M.: Scalable Context-Sensitive Flow Analysis using Instantiation Constraints. In: Proceedings of the 2000 ACM SIGPLAN Conference on Programming Language Design and Implementation, Vancouver B.C., Canada (June 2000) (to appear)

    Google Scholar 

  16. Foster, J.S., Fähndrich, M., Aiken, A.: Flow-Insensitive Points-to Analysis with Term and Set Constraints. Technical Report UCB//CSD-97-964, University of California, Berkeley (August 1997)

    Google Scholar 

  17. Foster, J.S., Fähndrich, M., Aiken, A.: Polymorphic versus Monomorphic Flowinsensitive Points-to Analysis for C. Technical report, University of California, Berkeley (April 2000)

    Google Scholar 

  18. Heintze, N., Jaffar, J.: A Decision Procedure for a Class of Set Constraints. In: Proceedings, Fifth Annual IEEE Symposium on Logic in Computer Science, Philadelphia, Pennsylvania, pp. 42–51 (June 1990)

    Google Scholar 

  19. Hind, M., Pioli, A.: Assessing the Effects of Flow-Sensitivity on Pointer Alias Analyses. In: Levi, G. (ed.) SAS 1998. LNCS, vol. 1503, pp. 57–81. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  20. Landi, W., Ryder, B.G.: A Safe Approximate Algorithm for Interprocedural Pointer Aliasing. In: Proceedings of the 1992 ACM SIGPLAN Conference on Programming Language Design and Implementation, San Francisco, California, June 1992, pp. 235–248 (1992)

    Google Scholar 

  21. Milner, R.: A Theory of Type Polymorphism in Programming. Journal of Computer and System Sciences 17, 348–375 (1978)

    Article  MATH  MathSciNet  Google Scholar 

  22. Mossin, C.: Flow Analysis of Typed Higher-Order Programs. PhD thesis, DIKU, Department of Computer Science, University of Copenhagen (1996)

    Google Scholar 

  23. O’Callahan, R., Jackson, D.: Lackwit: A Program Understanding Tool Based on Type Inference. In: Proceedings of the 19th International Conference on Software Engineering, Boston, Massachusetts, May 1997, pp. 338–348 (1997)

    Google Scholar 

  24. Odersky, M., Sulzmann, M., Wehr, M.: Type Inference with Constrained Types. In: Pierce, B. (ed.) Proceedings of the 4th International Workshop on Foundations of Object-Oriented Languages (January 1997)

    Google Scholar 

  25. Rémy, D.: Typechecking records and variants in a natural extension of ML. In: Proceedings of the 16th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Austin, Texas, January 1989, pp. 77–88 (1989)

    Google Scholar 

  26. Ruf, E.: Context-Insensitive Alias Analysis Reconsidered. In: Proceedings of the 1995 ACM SIGPLAN Conference on Programming Language Design and Implementation, La Jolla, California, June 1995, pp. 13–22 (1995)

    Google Scholar 

  27. Sagiv, M., Reps, T., Wilhelm, R.: Parametric Shape Analysis via 3-Valued Logic. In: Proceedings of the 26th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, San Antonio, Texas, January 1999, pp. 105–118 (1999)

    Google Scholar 

  28. Shapiro, M., Horwitz, S.: Fast and Accurate Flow-Insensitive Points-To Analysis. In: Proceedings of the 24th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Paris, France, January 1997, pp. 1–14 (1997)

    Google Scholar 

  29. Steensgaard, B.: Points-to Analysis in Almost Linear Time. In: Proceedings of the 23rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, St. Petersburg Beach, Florida, January 1996, pp. 32–41 (1996)

    Google Scholar 

  30. Su, Z., Fähndrich, M., Aiken, A.: Projection Merging: Reducing Redundancies in Inclusion Constraint Graphs. In: Proceedings of the 27th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Boston, Massachusetts (January 2000) (to appear)

    Google Scholar 

  31. Wilson, R.P., Lam, M.S.: Efficient Context-Sensitive Pointer Analysis for C Programs. In: Proceedings of the 1995 ACM SIGPLAN Conference on Programming Language Design and Implementation, La Jolla, California, June 1995, pp. 1–12 (1995)

    Google Scholar 

  32. Wright, A.K.: Simple Imperative Polymorphism. Lisp and Symbolic Computation 8 4, 343–356 (1995)

    Article  Google Scholar 

  33. Yong, S.H., Horwitz, S., Reps, T.: Pointer Analysis for Programs with Structures and Casting. In: Proceedings of the 1999 ACM SIGPLAN Conference on Programming Language Design and Implementation, Atlanta, Georgia, May 1999, pp. 91–103 (1999)

    Google Scholar 

  34. Zhang, S., Ryder, B.G., Landi, W.A.: Program Decomposition for Pointer Aliasing: A Step toward Practical Analyses. In: Fourth Symposium on the Foundations of Software Engineering (October 1996)

    Google Scholar 

  35. Zhang, S., Ryder, B.G., Landi, W.A.: Experiments with Combined Analysis for Pointer Aliasing. In: Proceedings of the ACM SIGPLAN/SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, Montreal, Canada, June 1998, pp. 11–18 (1998)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2000 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Foster, J.S., Fähndrich, M., Aiken, A. (2000). Polymorphic versus Monomorphic Flow-Insensitive Points-To Analysis for C. In: Palsberg, J. (eds) Static Analysis. SAS 2000. Lecture Notes in Computer Science, vol 1824. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-45099-3_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-45099-3_10

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-67668-3

  • Online ISBN: 978-3-540-45099-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics