[Bug fortran/64854] No bound check for explicit-shape arrays

bugs at stellardeath dot org gcc-bugzilla@gcc.gnu.org
Thu Jan 29 20:49:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64854

--- Comment #4 from Lorenz Hüdepohl <bugs at stellardeath dot org> ---
> The right way to fix the problem is to fix the program
> by using an appropriate programming style.  Writing
>
>      real    :: a(n1:)   ! not:  real :: a(n1:n2)
>
> one gets the expected check

I realize that, and when I write my own code I would never
use such a construction. However, sometimes one is burdened
with existing code in which small treasures such as this kind
of bug are hidden.

I was hoping that with -fcheck=bounds I could find this.

If the code was correct already there would be no need for
any kind of runtime checks, right?


More information about the Gcc-bugs mailing list