[Patch, Fortran] PR fortran/37746: -fbounds-check for string lengths of dummy arguments

Daniel Kraft d@domob.eu
Sun Dec 21 18:26:00 GMT 2008


Hi,

the attached patch implements a runtime check that the string length of 
an actual argument matches the expected one for a (non-assumed length) 
character dummy argument, if -fbounds-check is given.  This fixes PR 
37746 (the original test case, although it was meant to mean something 
else by the reporter, now gives the expected error), you may also want 
to look at the test cases for what this is supposed to catch.

I had to change two torture-tests because I believe they are wrong and 
the new check complained about this; please verify the changes are ok, 
although I'm quite sure I didn't change anything about the meaning of 
the test.  I'm not an expert about the code touched, so please feel free 
to find any things I did miss :D

Regression-testing at the moment on GNU/Linux-x86-32. Ok for trunk if no 
regressions?  I'm also open to queue this one up for 4.5, but as only 
behaviour with -fbounds-check active is affected, I think we can also 
put this in for 4.4, as it's also a bug fix.

Yours,
Daniel

PS: Sorry for that many test cases, but I don't think it is possible to 
check for multiple runtime errors with just one file; or is it?

-- 
Done:  Arc-Bar-Cav-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri-Ran
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch2.changelog
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20081221/3f6cdb9b/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch2.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20081221/3f6cdb9b/attachment-0001.ksh>


More information about the Gcc-patches mailing list