[Patch, fortran] PR30084 - segmentation falut when compiling certain code
Paul Thomas
paulthomas2@wanadoo.fr
Mon Dec 18 23:34:00 GMT 2006
:ADDPATCH fortran:
The attached patch fixes the seg fault that occurs when, in the testcase
provided, SIZE is used in an initialization expression and then in a
specification expression, in a procedure contained in another module.
The segfault occurs because the latter expression winds up without a
symtree pointing to the SIZE intrinsic. I tried to trace this one back
into resolve.c and decl.c but could not find anybody who had failed in
their duty. This fix is a bit of a kludge but I was unable to find one
that really looked "correct". I also dragged the fix for PR16861 and
PR24409 into the new function fix_mio_expr. This puts both such kludges
in the same place, in the hope that some bright spark can eliminate both
and the function. :-)
The fix depends on the symtree being null and the expression having a
function name. This being so, the function name can be used to look for
the required symtree, which is duly attached to the expression. The
testcase is that of the reporter, as reduced by Steve Kargl. I have
added a small main programme that does the right thing, even though the
testsuite only compiles this testcase.
Regtested on ia64/FC5 - OK for trunk and 4.2?
Paul
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Change.Logs
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20061218/6b2772e8/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr30084.diff
Type: text/x-patch
Size: 4617 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20061218/6b2772e8/attachment.bin>
More information about the Fortran
mailing list