Compiler Error Correction with Dynamic Optimization Adjustment
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current compilers halt the compilation process upon detecting errors, requiring users to manually identify and fix issues, which is time-consuming and frustrating, especially for minor errors.
Innovation Solution
Incorporating an error corrector module within the compiler driver to automatically correct user errors and an optimization adjustment module to handle internal compiler errors by iteratively adjusting optimization levels, allowing compilation to continue without user intervention.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the compiler halts the compilation process upon detecting errors, then the compiler can ensure correctness by not producing potentially incorrect output, but the compilation time increases significantly as users must manually identify and fix errors iteratively
Solution Approach 1:
The compiler automatically corrects its own detected errors without requiring user intervention. The error corrector module analyzes error messages, identifies the underlying issues, and applies corrections to the source code automatically, allowing the compilation process to continue without manual intervention while maintaining correctness through systematic error resolution
Solution Approach 2:
The compiler performs preliminary error analysis and correction before the compilation process completes. By proactively identifying and correcting errors during the compilation process rather than halting immediately, the system prepares the code for successful compilation in advance, reducing the need for iterative manual corrections
2Productivity
If the compiler uses high optimization levels, then the performance of the compiled code is improved, but internal compiler errors may occur that halt compilation
Solution Approach 1:
The optimization level is made dynamic rather than static. The compiler automatically adjusts optimization levels during the compilation process based on the complexity and characteristics of different code sections. High optimization is applied where safe and beneficial, while lower optimization is used where it prevents internal errors, allowing the system to adapt optimization intensity in real-time
Solution Approach 2:
The compiler changes optimization parameters automatically to resolve internal errors. When an internal error is detected, the system modifies optimization level parameters and other compilation parameters to alternative values, allowing compilation to proceed with adjusted settings that maintain performance while avoiding error-prone configurations
3Productivity
If the compiler applies aggressive optimization to all functions, then overall performance is maximized, but errors in specific functions cause the entire compilation to fail
Solution Approach 1:
The compilation process is segmented at the function level, allowing independent optimization and error handling for each function. The error corrector identifies which specific function contains the error and applies corrections or optimization adjustments only to that function, rather than failing the entire compilation or applying conservative optimization to all functions
Solution Approach 2:
Different optimization levels and error correction strategies are applied locally to different functions based on their specific characteristics and error profiles. High optimization is applied to functions that can tolerate it, while lower optimization or different correction strategies are applied to functions where aggressive optimization causes internal errors, creating a heterogeneous optimization landscape
Data Source
AI summary
A compilation method is provided for correcting compiler errors that include compiler internal errors and errors produced by running a validation suite. The method includes running a compiler on a computer and storing a set of optimization levels in memory accessible by the compiler. The method includes receiving a source file with the compiler that includes a user-defined optimization level to be used in compiling the source file. The method includes identifying a set of functions within the source file and using compiler components to compile these functions using the original optimization level. When the compiling results in an internal error occurring and being reported for one or more of the functions, the method includes using an optimization adjustment module to process the internal error and assign an adjusted or lower optimization level to the one or more functions and recompiling of these functions again with the lower optimization level.


