This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch, fortran] PR67564 Segfault on sourced allocation statement with class(*) arrays
- From: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- To: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 31 Jan 2016 12:15:35 +0100
- Subject: [Patch, fortran] PR67564 Segfault on sourced allocation statement with class(*) arrays
- Authentication-results: sourceware.org; auth=none
Dear All,
2016-01-31 Paul Thomas <pault@gcc.gnu.org>
PR fortran/67564
* trans-expr.c (gfc_conv_procedure_call): For the vtable copy
subroutines, add a string length argument, when the actual
argument is an unlimited polymorphic class object.
2016-01-31 Paul Thomas <pault@gcc.gnu.org>
PR fortran/67564
* gfortran.dg/allocate_with_source_17.f03: New test.
Committed as 'obvious' in revision 233016.
Dominique had tested a more elaborate version of the patch, which
included a big chunk in trans-array.c. It turns out that this is not
needed and the one-liner above is truly obvious.
I have posted on the PR another one-liner that fixes the problem on
5-branch and allows the testcase to run correctly. Slightly
mysteriously, the unlimited polymorphic argument is not arriving with
the unlimited attribute. That said, there is no reason, logically, to
test for unlimitedness, since it is the only condition in which a
character can be copied to a class object. It regtests OK, so OK for
5-branch too?
Cheers
Paul