Hi, Giogio.
Glad to hear it pointed you in the right direction.
There is always a balance between desired speed and risk. I think Niklaus Wirth recommended bounds checking on arrays
particularly for a production code. The idea is that one's results are worthless, even dangerous, if they are produced quickly but incorrectly.
At a place I once worked specializing in big iron:
Big iron - Wikipedia, the free encyclopedia , we often said that if you don't care about the reliability of the answers, we can make the computation arbitrarily fast
In any event, -fbounds-check is a useful debugging feature.
Best wishes ... cheers, drl