Summary: | Regression on character function with gfortran 4.7 | ||
---|---|---|---|
Product: | gcc | Reporter: | Damian Rouson <damian> |
Component: | fortran | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | burnus, damian |
Priority: | P3 | ||
Version: | 4.7.0 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | ||
Attachments: | Patch for 52158 and 45170#19 |
Description
Damian Rouson
2012-02-07 20:52:01 UTC
Possible patch: http://gcc.gnu.org/ml/fortran/2012-02/msg00031.html While the patch fixes a bogus error, it also protected the compiler from an - unrelated - ICE involving deferred-length function results: One now gets for PR 45170 comment #19 a segfault instead of the bogus error message. Cf. http://gcc.gnu.org/ml/fortran/2012-02/msg00035.html Created attachment 27323 [details]
Patch for 52158 and 45170#19
Patch realized on gcc version 4.8.0 20120505
Hi all, with the Tobias support I realized this patch (which includes the Paul one) for PR 45170#19. I'm a newbie, so I'm waiting for comments before to send the patch to gcc-fortran and gcc-patches mailing lists. Regards. Author: burnus Date: Sun May 13 10:52:32 2012 New Revision: 187436 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187436 Log: 2012-05-13 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com> Tobias Burnus <burnus@net-b.de> PR fortran/52158 PR fortran/45170 PR fortran/49430 * resolve.c (resolve_fl_derived0): Deferred character length procedure components are supported. * trans-expr.c (gfc_conv_procedure_call): Handle TBP with deferred-length results. (gfc_string_to_single_character): Add a new check to prevent NULL read. (gfc_conv_procedure_call): Remove unuseful checks on symbol's attributes. Add new checks to prevent NULL read on string length. 2012-05-13 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com> PR fortran/45170 * gfortran.dg/deferred_type_param_3.f90: New. * gfortran.dg/deferred_type_proc_pointer_1.f90: New. * gfortran.dg/deferred_type_proc_pointer_2.f90: New. Added: trunk/gcc/testsuite/gfortran.dg/deferred_type_param_3.f90 trunk/gcc/testsuite/gfortran.dg/deferred_type_proc_pointer_1.f90 trunk/gcc/testsuite/gfortran.dg/deferred_type_proc_pointer_2.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/resolve.c trunk/gcc/fortran/trans-expr.c trunk/gcc/testsuite/ChangeLog FIXED on thr 4.8 trunk. Thanks Damian for the test case (in this PR and in PR 45170 comment 19). |