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

Hi all,

In my view, it would be preferable to have bound checking enabled by
default. At debug time one should be expecting low performance anyway.
And, as Daniel pointed out, with the next Photran update different build
preferences can be saved.

Regards,

Fernando

Jeffrey Overbey escribió:
>>
>> 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
> _______________________________________________
> photran mailing list
> photran@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/photran
>




Back to the top