
12 May
2011
12 May
'11
11:36 a.m.
I also noticed that the described symptoms are not merely a result of compiler optimizations. I was experimenting with different GCC optimization parameters in an attempt to identify the guilty ones when I noticed that even when optimizations are completely turned off, some weird behavior "can" occur. When I run the snippet provided below, compiled with -O0, several times, the program behaves as expected about half of the times and in the other runs, the map find function will fail to find any entries, resulting in a matrix consisting of ones instead of twos. In higher optimization levels, the find function fails consistently.
Any chance valgrind can help? Sounds like unitialized read for me. -- Slava