[Patch, Fortran] PR fortran/38137: Runtime check for stringlengths to MERGE
Tobias Burnus
burnus@net-b.de
Wed Dec 17 10:18:00 GMT 2008
Hi Daniel,
Daniel Kraft wrote:
> this patch adds a runtime check (when -fbounds-check is enabled) that
> the arguments to MERGE have the same string length; currently this is
> only checked at compile-time when possible. The patch should be
> straight forward, if I didn't mess up some of the tree stuff.
>
> I'm not sure if other intrinsics are affected as well, but check.c
> does compile-time checks for same string lengths only for MERGE. But
> feel free to suggest others and I can add both compile-time and
> runtime checks for them :)
I think MERGE is the only Fortran 2003 intrinsic where the length type
parameter has to be the same. But the same-length check might be
recycled for PR 31822, which is about pointer assignment rather than
actual arguments. (Also there: compile-time check works, run-time check
is missing.)
(Currently, I have the problem that I cannot find the "=>" constrain in
the standard (95/2003) - as all compilers have the compile-time check I
surely miss something.)
> Regression test running at the moment on GNU/Linux-x86-32. Ok for
> trunk if no regressions? I believe this is can go in for 4.4 without
> problems (but can hold on until 4.5 too if you want).
Looks harmless and is only active with -fbounds-check. Thus: OK for the
trunk.
Tobias
More information about the Fortran
mailing list