Compiler: IAR 4.21.6
The SPI is set up as slave. Master clock is 312.5 kHz
Observation:
The MISO line is not synchronized to the rising edge of the clock input.
This can rarely happen right after a power-on-reset. It may also rarely happen during longer runtime of the software (several hours).
Most of the time everything works according to SPI spec and without any problems.
Logic analyzer recordings:
In the event of the described error, a delay can be observed between the rising edge of the clock line and the change in the data line (MISO).
This delay increases during runtime until the data change of the MISO line and the falling edge of the clock line happen at the same moment.
When this happens, the master is no longer able to correctly interpret the transmitted data.
Communication right after reset:

Right after reset, there is already a delay of ~750ns observable. The MISO line should change its output with the rising edge.
Miso timing shifts:
300 ms after the reset, the data line change shifted further towards the falling edge of the clock.

Last “successful” communication:
1.04 seconds after the reset, the data line change is almost coincident to the falling edge of the clock line.

How is it possible that the SPI unit of the processor behaves this way?