We have found a bug where the compiler generates faulty code if variable reference is used. See code snippet bellow.
const KeyValuePair<T, u32> pair = pairs[i]; const KeyValuePair<T, u32>& pair = pairs[i];
Note that these code snippet is inside a loop over pairs.
I have successfully generated Compiler Test Case for this issue but I would like to send it as a private message.