[Patch, fortran] PR26787 - Assigning to function causes ice in gfortran
Paul Thomas
paulthomas2@wanadoo.fr
Thu Apr 13 18:51:00 GMT 2006
:ADDPATCH fortran:
The message to Bugzilla was:
The following incorrect code causes:
simple.f90: In function 'bar'
simple.f90:4: internal compiler error: in gfc_conv_variable, at
fortran/trans-expr.c:355
Code:
module simple
implicit none
contains
integer function foo()
foo = 10
end function foo
subroutine bar()
foo = 10
end subroutine bar
end module simple
This should cause an error, rather than an internal compiler error.
...which is clear and concise enough. The fix required a bit of work in
expr.c (gfc_check_assign), which speaks for itself I think The testcase
is intended to be fairly complete - it checks what was broken and what
was not broken. Notice that I have not yet attempted to sort out
entries; this can come in a package with a number of other, related
checks that are subjects of PRs.
Regtested on FC3/Athlon - OK for trunk and I propose, since assignment
is so basic, a couple of weeks later on 4.1, so as to give the pact a
good shaking down.
Paul
2006-04-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/26822
* expr.c (gfc_check_assign): Extend scope of arror to include
assignments to a procedure in the main program or, from a
module or internal procedure that is not that represented by
the lhs symbol.
2006-04-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/26822
* gfortran.dg/proc_assign_1.f90: New test.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: assign.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060413/9afd0c38/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: proc_assign_1.f90
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060413/9afd0c38/attachment.f90>
More information about the Fortran
mailing list