[Bug fortran/70870] Segmentation violation in gfc_assign_data_value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70870 --- Comment #3 from kargl at gcc dot gnu.org --- Index: data.c === --- data.c (revision 238178) +++ data.c (working copy) @@ -489,6 +489,15 @@ gfc_assign_data_value (gfc_expr *lvalue, } else { + if (lvalue->ts.type == BT_DERIVED + && gfc_has_default_initializer (lvalue->ts.u.derived)) + { + gfc_error ("Nonpointer object %qs with default initialization " +"shall not appear in a DATA statement at %L", +symbol->name, &lvalue->where); + return false; + } + /* Overwriting an existing initializer is non-standard but usually only provokes a warning from other compilers. */ if (init != NULL) % gfc -c -Wall a.f90 a.f90:6:4: data v2/t(2)/ ! this is wrong 1 Error: Nonpointer object 'v2' with default initialization shall not appear in a DATA statement at (1)
[Bug fortran/70870] Segmentation violation in gfc_assign_data_value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70870 Dominique d'Humieres changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2016-04-29 Ever confirmed|0 |1 --- Comment #1 from Dominique d'Humieres --- Confirmed from 4.8 up to trunk (7.0).
[Bug fortran/70870] Segmentation violation in gfc_assign_data_value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70870 --- Comment #2 from Gerhard Steinmetz --- A variant that aborts with this message directly : $ gfortran-6 z1.f90 f951: internal compiler error: in gfc_assign_data_value, at fortran/data.c:449 $ cat z1.f90 program p type t integer :: n end type type(t), pointer :: z => null() data z%n / 3 / print *, z%n end --- A minimal change of z1.f90 immediately points to pr50410 : $ cat z2.f90 program p type t integer :: n end type type(t), pointer :: z data z%n / 3 / print *, z%n end $ gfortran-6 z2.f90 f951: internal compiler error: in record_reference, at cgraphbuild.c:64
[Bug fortran/70870] Segmentation violation in gfc_assign_data_value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70870 kargl at gcc dot gnu.org changed: What|Removed |Added CC||kargl at gcc dot gnu.org --- Comment #4 from kargl at gcc dot gnu.org --- Hmm.
[Bug fortran/70870] Segmentation violation in gfc_assign_data_value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70870 --- Comment #5 from Vittorio Zecca --- After applying the fix in comment 3 to trunk 258946 the ICE disappears and an error message appears, as it should be.
[Bug fortran/70870] Segmentation violation in gfc_assign_data_value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70870 Thomas Koenig changed: What|Removed |Added CC||tkoenig at gcc dot gnu.org --- Comment #6 from Thomas Koenig --- (In reply to kargl from comment #4) > Hmm. Patch from comment #3 looks good, and obvious, to me. So, pre-approved if it survives regression-testing on a recent trunk.
[Bug fortran/70870] Segmentation violation in gfc_assign_data_value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70870 --- Comment #7 from kargl at gcc dot gnu.org --- (In reply to Gerhard Steinmetz from comment #2) > A variant that aborts with this message directly : > > $ gfortran-6 z1.f90 > f951: internal compiler error: in gfc_assign_data_value, at > fortran/data.c:449 > > $ cat z1.f90 > program p >type t > integer :: n >end type >type(t), pointer :: z => null() >data z%n / 3 / >print *, z%n > end > > --- > > A minimal change of z1.f90 immediately points to pr50410 : > > $ cat z2.f90 > program p >type t > integer :: n >end type >type(t), pointer :: z >data z%n / 3 / >print *, z%n > end > > $ gfortran-6 z2.f90 > f951: internal compiler error: in record_reference, at cgraphbuild.c:64 These "variant" are different problems than the one in the intial post. The original problem is considered with an entity that has a default initializer appearing in a DATA statement. The above examples are issues with a unassociated pointer appearing a DATA statement. These should have a new PR opened for them.
[Bug fortran/70870] Segmentation violation in gfc_assign_data_value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70870 G. Steinmetz changed: What|Removed |Added CC||gs...@t-online.de --- Comment #8 from G. Steinmetz --- > These should have a new PR opened for them. Done. This is now pr85506.
[Bug fortran/70870] Segmentation violation in gfc_assign_data_value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70870 --- Comment #9 from Steve Kargl --- On Mon, Apr 23, 2018 at 07:46:59PM +, gs...@t-online.de wrote: > > --- Comment #8 from G. Steinmetz --- > > These should have a new PR opened for them. > Done. This is now pr85506. > Thanks. I had intended to open the new PR when I committed the patch, but a severe lack of time has caused a delay.
[Bug fortran/70870] Segmentation violation in gfc_assign_data_value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70870 --- Comment #10 from kargl at gcc dot gnu.org --- Author: kargl Date: Thu May 10 22:43:00 2018 New Revision: 260138 URL: https://gcc.gnu.org/viewcvs?rev=260138&root=gcc&view=rev Log: 2018-05-10 Steven G. Kargl PR fortran/70870 * data.c (gfc_assign_data_value): Check that a data object does not also have default initialization. 2018-05-10 Steven G. Kargl PR fortran/70870 * gfortran.dg/pr70870_1.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/pr70870_1.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/data.c trunk/gcc/testsuite/ChangeLog
[Bug fortran/70870] Segmentation violation in gfc_assign_data_value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70870 --- Comment #11 from kargl at gcc dot gnu.org --- Author: kargl Date: Fri May 11 17:32:28 2018 New Revision: 260171 URL: https://gcc.gnu.org/viewcvs?rev=260171&root=gcc&view=rev Log: 2018-05-11 Steven G. Kargl PR fortran/70870 Backport from trunk * data.c (gfc_assign_data_value): Check that a data object does not also have default initialization. 2018-05-11 Steven G. Kargl PR fortran/70870 Backport from trunk * gfortran.dg/pr70870_1.f90: New test. Added: branches/gcc-8-branch/gcc/testsuite/gfortran.dg/pr70870_1.f90 Modified: branches/gcc-8-branch/gcc/fortran/ChangeLog branches/gcc-8-branch/gcc/fortran/data.c branches/gcc-8-branch/gcc/testsuite/ChangeLog
[Bug fortran/70870] Segmentation violation in gfc_assign_data_value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70870 --- Comment #12 from kargl at gcc dot gnu.org --- Author: kargl Date: Fri May 11 18:00:41 2018 New Revision: 260176 URL: https://gcc.gnu.org/viewcvs?rev=260176&root=gcc&view=rev Log: 2018-05-11 Steven G. Kargl PR fortran/70870 Backport from trunk * data.c (gfc_assign_data_value): Check that a data object does not also have default initialization. 2018-05-11 Steven G. Kargl PR fortran/70870 Backport from trunk * gfortran.dg/pr70870_1.f90: New test. Added: branches/gcc-7-branch/gcc/testsuite/gfortran.dg/pr70870_1.f90 Modified: branches/gcc-7-branch/gcc/fortran/ChangeLog branches/gcc-7-branch/gcc/fortran/data.c branches/gcc-7-branch/gcc/testsuite/ChangeLog
[Bug fortran/70870] Segmentation violation in gfc_assign_data_value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70870 --- Comment #13 from kargl at gcc dot gnu.org --- Author: kargl Date: Fri May 11 18:35:20 2018 New Revision: 260181 URL: https://gcc.gnu.org/viewcvs?rev=260181&root=gcc&view=rev Log: 2018-05-11 Steven G. Kargl PR fortran/70870 Backport from trunk * data.c (gfc_assign_data_value): Check that a data object does not also have default initialization. 2018-05-11 Steven G. Kargl PR fortran/70870 Backport from trunk * gfortran.dg/pr70870_1.f90: New test. Added: branches/gcc-6-branch/gcc/testsuite/gfortran.dg/pr70870_1.f90 Modified: branches/gcc-6-branch/gcc/fortran/ChangeLog branches/gcc-6-branch/gcc/fortran/data.c branches/gcc-6-branch/gcc/testsuite/ChangeLog
[Bug fortran/70870] Segmentation violation in gfc_assign_data_value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70870 kargl at gcc dot gnu.org changed: What|Removed |Added Priority|P3 |P4 Status|NEW |RESOLVED Resolution|--- |FIXED Target Milestone|--- |6.5 --- Comment #14 from kargl at gcc dot gnu.org --- Fixed.