Re: [patch, fortran, RFC] warn about out-of-bounds errors in DO loops

2017-09-14 Thread Thomas Koenig
Hi Richard, Is it OK to throw a hard error for this? Maybe the rules are different from C and C++, but normally we can't do that for code that's only invalid if executed. An unconditional warning would be good though. I can also issue an unconditional warning; this will even simplify the cod

Re: [patch, fortran, RFC] warn about out-of-bounds errors in DO loops

2017-09-12 Thread Richard Sandiford
Thanks for doing this, looks really useful. Thomas Koenig writes: > Well, here's a version which actually throws a hard error in > obvious cases; the other cases are reserved for -Wextra. Is it OK to throw a hard error for this? Maybe the rules are different from C and C++, but normally we can'

Re: [patch, fortran, RFC] warn about out-of-bounds errors in DO loops

2017-09-11 Thread Thomas Koenig
Well, here's a version which actually throws a hard error in obvious cases; the other cases are reserved for -Wextra. Turns up a few bugs in the testsuite, too. An interesting one is unconstrained_commons.f, where the code quite happily saves and stores outside a common block array with a single

[patch, fortran, RFC] warn about out-of-bounds errors in DO loops

2017-09-10 Thread Thomas Koenig
Hello world, the attached patch warns about certain cases where out-of-bound array accesses can be detected at compile time. This was inspired by an out-of-bound access in Polyhedron. A preliminary version of this patch has already found one error in the testsuite. The problem is what to warn f