Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [photran] Request for adding -fcheck=all to the default GCC Debug config

I suggest adding -fcheck=all to the default GCC Debug config (or at least -fcheck=bounds),

Hmm... my version of gfortran (4.4.2) doesn't have an -fcheck=all, although there's an -fcheck-bounds options.

Typically, a "debug configuration" would certainly have debug symbols enabled, and probably it would have assertions enabled.  Fortran doesn't have assertions, but checking that array accesses are in bounds would be a typical one.  So it makes sense to enable it.

The problem is that it can be pretty expensive.  At -O0 (no compiler optimizations), my toy Gaussian Elimination runs in 6.7 seconds without -fcheck-bounds, and 12.2 seconds with -fcheck-bounds.  Now, it's debatable whether this speed difference matters in a debug configuration.  But with that big of a performance hit, you could argue that it should be disabled by default and only enabled if the user explicitly decides to make that safety/performance trade-off.

I guess my point is that you can make a solid argument for adding -fcheck-bounds to the defaults, and you can make a solid argument against it.  What do others think?

Jeff

Back to the top