Patent ID: 8245110

Claim:
An error correcting code generation method, comprising: storing data to be stored in a store instruction in a buffer; searching a cache memory to perform a judgment as to whether the data to be stored exists in the cache memory; when the data to be stored exists in the cache memory according to the judgment, generating a first error correcting code on the basis of data other than the data to be stored that was read out from the cache memory with the search of the cache memory, and keeping the generated first error correcting code; generating a second error correcting code on the basis of the data to be stored in the buffer; and generating an error correcting code for the data by merging the first error correcting code and the second error correcting code, wherein a judgment as to whether a store address in a preceding store instruction corresponds to a store address in a current store instruction, and a judgment as to whether a data width of the data to be stored in the current store instruction corresponds to a predetermined data width are performed, and when the preceding store instruction having a same store address exists and the data width of the data in the current store instruction is smaller than the predetermined data width, ECC validity information showing whether the first error correcting code is appropriate is set as invalid, and the ECC validity information is associated and stored with the data and the first error correcting code.