Patent ID: 8286145
Filing Date: 2012-10-09
Classification: G06F

Abstract:
1. A program re-writing apparatus which re-writes an inputted program into a program for a processor for controlling whether or not a process is executed based on a yes or no execution flag, said program re-writing apparatus comprising: a comparison process inserter, comprising a processor, configured to insert a comparison process into the inputted program, the comparison process comparing first address information, which is memory address information accessed by a store process included in the inputted program, and second address information, which is address information of a memory accessed by a load process included in the inputted program, and writing a comparison result into the yes or no execution flag; a logic preservation process inserter, comprising a processor, configured to insert a yes or no execution flag-attached logic preservation process into the inputted program, the yes or no execution flag-attached logic preservation process being a process executed based on a value of the yes or no execution flag and preserving a same result as a result of the inputted program when executed; and an ambiguous memory dependence analyzer configured to analyze whether or not there is an ambiguous true memory dependence relationship between the store process and the load process; an execution sequence modifier configured to modify an execution sequence of the store process and the load process which have been judged to be in an ambiguous true memory dependence relationship by said ambiguous memory dependence analyzer; and a data size comparator configured to judge whether or not a predetermined condition is satisfied, the condition being that a size of data accessed once by the store process and a size of data accessed once by the load process are equal, wherein the store process is a process for writing data into the memory, the load process is a process for reading data out of the memory, and said logic preservation process inserted is configured to insert, when it is judged by said data size comparator that the predetermined condition is satisfied, an overwrite process into the inputted program, the overwrite process is a process in which the store process overwrites a value read out of the memory by the load process with a value written into the memory, as the logic preservation process.