The present invention relates to the technical field of compilers, and particularly to a method for indirect prefetch address out-of-bounds check based on the GCC
compiler. The method for indirect prefetch address out-of-bounds check based on the GCC
compiler includes: S1: In the indirect prefetch
insertion stage, insert multiple GIMPLE statements to load the index array values, and then perform index out-of-bounds check; S2: Convert to two different memory reference types in the GIMPLE intermediate representation stage; S3: Adopt different out-of-bounds check methods for different memory reference types to obtain the maximum value of the induction variable, that is, the maximum index value of the index array; S4: Select different address out-of-bounds avoidance methods according to the memory
reference type of the index array; S5: Perform the above address out-of-bounds check and load the index array values. The method for indirect prefetch address out-of-bounds check based on the GCC
compiler provided by the present invention has the advantages of effectively reducing the
workload and work difficulty of programmers. In particular, it reduces the huge performance overhead caused by instruction jumps.