Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Method and System for Compiling Source Code Containing Potential Aliasing Violations

IP.com Disclosure Number: IPCOM000232303D
Publication Date: 2013-Oct-30
Document File: 5 page(s) / 49K

Publishing Venue

The IP.com Prior Art Database

Abstract

Disclosed is a novel method for compiling source code containing type-based aliasing rule violations at optimization levels. The method is to perform an inter-procedural pointer analysis to fix the issues of the aliasing violations detected. This allows the compilation to continue the optimizations for the aliasing fixed code to generate executable code with improved performance for the program.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 32% of the total text.

Page 01 of 5

Method and System for Compiling Source Code Containing Potential Aliasing Violations

Aliasing occurs when two or more variables refer to the same storage location at the same program point. Many programming languages have language aliasing rules to describe which storage location references may alias to each other. For example, the ISO/IEC standards for the C and C++ programming languages specify that it is illegal for pointers or references of not closely related types to reference the same memory location. These rules restrict how programmers may develop the source program, and often allow compilers to perform optimizations on the source code to achieve impressive increases in runtime performance.

However, common coding practice often violates the type-based aliasing rules by dereferencing a pointer and casting it to point to an incompatible type. These violations can result in unexpected behaviors in the executables generated by a compiler, particularly at higher optimization levels, when the compiler assumes the user code follows the standard

aliasing rules. Recently, a method has been proposed to accurately and reliably detect the violations of aliasing rules in the whole program*. The method is:

1. To perform inter-procedural pointer analysis to find the broadest possible target set of objects to which a pointer can point at any specific point in the program

2. To find the aliasing violations of indirection operations of pointer variables by identifying contradictions among the pointer target sets gathered from the pointer analysis and the global aliasing representation created based on the aliasing rules

This method can help programmers correct the aliasing issues in the program source code. However, it is often difficult to correct the aliasing violations in programs, especially for legacy code, because even the programmer may not understand the program well; therefore, the programmer may have to lower the optimizations level or disable the aliasing assertions to compile the program for the correctness of the program execution at runtime. For example, if aliasing violations are found using the method *, then, in order to fix those aliasing violations, much of the code of the benchmark must be rewritten.

Therefore, a method is needed for a compiler to tolerate the detected aliasing violations at the optimization level while generating correct optimized code for programs.

The solution is a novel method for compiling source code containing type-based aliasing rule violations at optimization levels. The method is to perform an inter-procedural pointer analysis to fix the issues of the aliasing violations detected. This allows the compilation to continue the optimizations for the aliasing fixed code to generate executable code with improved performance for the program.

1


Page 02 of 5

An inter-procedural compilation method is provided for compiling source code containing type-based aliasing rule violations at optimization level...