Abstract
Analyses and transformations of programs that manipulate pointer-based data structures rely on understanding the topological relationships between the nodes i.e., the overall shape of the data structures. Current static shape analyses either assume correctness of the code or trade-off accuracy for analysis performance, leading in most cases to shape information that is of little use for practical purposes. This paper introduces four novel analysis techniques, namely structural fields, scan loops, assumed/verified shape properties and context tracing. Analysis of structural fields allows compilers to uncover node configurations that play key roles in the data structure. Analysis of scan loops allows compilers to establish accurate relationship between pointer variables while traversing the data structures. Assumed/verified property analysis derives sufficient shape properties that guarantee termination of scan loops. These properties must then be verified during shape analysis for consistency. Context tracing allows the analyses to isolate data structure nodes by tracing relationships between pointer variables along control-flow paths in the program. We believe that future static shape and safety analysis algorithms will have to include some if not all of these techniques to attain a high level of accuracy. In this paper we illustrate the application of the proposed techniques to codes that build (correctly as well as incorrectly) data structures that are beyond the reach of current approaches.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Ball, T., Majumdar, R., Millstein, T., Rajamani, S.: Automatic Predicate Abstraction of C Programs. In: Proc. of the ACM Conference on Programming Language Design and Implementation, June 2001, pp. 203–213. ACM Press, New York (2001)
Chase, D., Wegman, M., Zadek, F.: Analysis of Pointers and Structures. In: Proc. of the ACM Conference on Program Language Design and Implementation, June 1990, pp. 296–310. ACM Press, New York (1990)
Choi, J., Burke, M., Carini, P.: Efficient Flow-Sensitive Interprocedural Computation of Pointer-induced Aliases and Side Effects. In: Proc. of the Twentieth Annual ACM Symp. on the Principles of Programming Languages, January 1993, pp. 232–245. ACM Press, New York (1993)
Corbera, F., Asenjo, R., Zapata, E.: Accurate Shape Analysis for Recursive Data Structures. In: Midkiff, S.P., Moreira, J.E., Gupta, M., Chatterjee, S., Ferrante, J., Prins, J.F., Pugh, B., Tseng, C.-W. (eds.) LCPC 2000. LNCS, vol. 2017, p. 1. Springer, Heidelberg (2000)
Deutsh, A.: Interprocedural may-alias analysis for pointers: Beyond k-limiting. In: Proc. of the ACM Conference on Program Language Design and Implementation, June 1994, pp. 230–241. ACM Press, New York (1994)
Ghiya, R., Hendren, L.: Is it a Tree, a DAG, or a Cyclic Graph? a Shape Analysis for Heap-directed Pointers in C. In: Proc. of the Twenty-third Annual ACM Symp. on the Principles of Programming Languages, January 1996, pp. 1–15. ACM Press, New York (1996)
Hendren, L., Hummel, J., Nicolau, A.: A General Data Dependence Test for Dynamic, Pointer-based Data Structures. In: Proc. of the ACM Conference on Program Language Design and Implementation, June 1994, pp. 218–229. ACM Press, New York (1994)
Hummel, J., Hendren, L., Nicolau, A.: A language for conveying the aliasing properties of pointer-based data structures. In: Proc. of the 8th International Parallel Processing Symposium, April 1994, pp. 218–229. IEEE Computer Society Press, Los Alamitos (1994)
Kuncak, V., Lam, P., Rinard, M.: Role Analysis. In: Proc. of the Twenty-nineth Annual ACM Symp. on the Principles of Programming Languages, pp. 17–32. ACM Press, New York (2002)
Larus, J., Hilfinger, P.: Detecting Conflicts between Structure Accesses. In: Proc. of the ACM Conference on Program Language Design and Implementation, June 1988, pp. 21–34. ACM Press, New York (1988)
Necula, G., Lee, P.: The Design and Implementation of a Certifying Compiler. In: Proc. of the ACM Conference on Programming Language Design and Implementation, pp. 333–344. ACM Press, New York (1998)
Plevyak, J., Karamcheti, V., Chien, A.: Analysis of Dynamic Structures for Efficient Parallel Execution. In: Banerjee, U., Gelernter, D., Nicolau, A., Padua, D.A. (eds.) LCPC 1993. LNCS, vol. 768, pp. 37–57. Springer, Heidelberg (1993)
Sagiv, M., Reps, T., Wilhelm, R.: Parametric Shape Analysis via 3-valued Logic. In: Proc. of the Twenty-sixth Annual ACM Symp. on the Principles of Programming Languages, January 1999. ACM Press, New York (1999)
Sagiv, M., Reps, T., Wilhelm, R.: Solving Shape-Analysis Problems in Languages with Destructive Updating. ACM Transactions on Programming Languages and Systems 20(1), 1–50 (1998)
Wilson, R., Lam, M.: Efficient Context-Sensitive Pointer Analysis for C Programs. In: Proc. of the ACM Conference on Programming Language Design and Implementation, June 1995, pp. 1–12. ACM Press, New York (1995)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Diniz, P.C. (2004). Increasing the Accuracy of Shape and Safety Analysis of Pointer-Based Codes. In: Rauchwerger, L. (eds) Languages and Compilers for Parallel Computing. LCPC 2003. Lecture Notes in Computer Science, vol 2958. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24644-2_31
Download citation
DOI: https://doi.org/10.1007/978-3-540-24644-2_31
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-21199-0
Online ISBN: 978-3-540-24644-2
eBook Packages: Springer Book Archive