Can you try to compile with NO optimization (Project options > Compilation and linking).
or alternatively put this in your code (right after the unit line)
unit my_unit;
{$Optimization PEEPHOLE off}
There is a tiny chance that might help.
Also just to be sure => in your examples you have just one or two local vars => in your real code, is it about a local variable too? or maybe a field in an object "form1.mystring" ?