3 ms·
GCC/G++ will remove bounds checking on O3 I think.
by gravypod 9y ago
GCC/G++ will remove bounds checking on O3 I think.
- lvh 9y agoGP is saying the contrapositive for Fortran: you can have runtime bounds checks during development instead of disabling them for production builds. I'm not sure which feature you're referring to, because while GCC has -fbounds-check, that's for the GNU Compiler Collection and only for frontends that support it (to wit, Fortran and Java). I don't know of any runtime bounds checking that ever made it into vanilla. Clang and GCC both have some limited array bounds checking, but it's static, and there are plenty of issues it won't catch. People maintained third party patches for a long time, but these are obsolete now. Perhaps you're thinking of ASAN/-fstack-protector-*?
- pletnes 9y agoIt’s a separate flag, independent of optimization, on all Fortran compilers I’ve used AFAIR (nag, intel, pgi, gfortran).