Hello Peter,
Thanks for looking at this. Does it run consistently at -O1? (At -O3, sometimes it works, sometimes it doesn't)
You are right, I tested using your script, and the program crashes randomly.
I should have mentioned earlier, I have a little test script, that I attached to #1001667 A run of a minute or two would suffice to show any issues. Would be interesting to know what happens with -O2, as I like to use the highest optimisation that is stable. Wondering whether this really is a bug in gcc...
I tried multiple approaches and found that reducing the optimization level from -O3 to -O2,-O1 does not resolve the segmentation faults.
However, when I removed only the -ffast-math flag (while keeping other optimizations) from Makefile.am, the program ran consistently without any segmentation faults.
This seems to indicate that the instability is likely related to the -ffast-math flag, rather than the optimization level itself.
Thanks Trupti