One embodiment disclosed relates to a method of compiling a program to be
executed on a target central processing unit (CPU). The method includes
opportunistically scheduling diagnostic testing of CPU registers. The
method may include use of a predetermined level of aggressiveness for the
scheduling of the register diagnostic testing. The scheduled diagnostic
testing may include writing known data to a register, reading data from
the register, and comparing the known data with the data that was read.
If the comparison indicates a difference, then a jump may occur to a
fault handler routine.