[4.5, Patch, Fortran] PR34656 - Add -fruntime-check=do for DO variable checks

Tobias Burnus burnus@net-b.de
Sun Dec 7 00:23:00 GMT 2008


this patch adds two run-time checks for DO loops:
a) That the DO step is not zero
b) That a loop variable is not modified

Contrary to other compilers, the error message is a bit unspecific (it
points to the DO line and does not even contain the name of the DO
variable [code->sym* is NULL]), but on the other hand it detects
modifications other compilers do not detect (see PR). If someone has an
idea how the diagnostics can be improved ...

Also this patch needs Paul's/FX's patch and also does not include any
documentation. Due to interdiff problems, the libgfortran.h and
options.c part needs to be applied by hand for testing.


PS: That patch fixes also ARG5 on
http://www.polyhedron.com/pb05-linux-diagnose0html and thus 44->46%.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: docheck.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20081207/d1dffb7c/attachment.ksh>

More information about the Gcc-patches mailing list