Summary: | [4.8/4.9 regression] NULL(): Fortran 2003 changes, accepts invalid, ICE on invalid | ||
---|---|---|---|
Product: | gcc | Reporter: | Tobias Burnus <burnus> |
Component: | fortran | Assignee: | Paul Thomas <pault> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs, janus, mikael, zeccav |
Priority: | P4 | Keywords: | accepts-invalid, diagnostic, ice-on-invalid-code, rejects-valid |
Version: | 4.3.0 | ||
Target Milestone: | 4.8.3 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2009-03-29 08:19:05 | |
Bug Depends on: | |||
Bug Blocks: | 20585 |
Description
Tobias Burnus
2007-12-21 10:23:48 UTC
See also http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/f014195ccf7b93e6/ for some other possible diagnostic issues. *** Bug 44349 has been marked as a duplicate of this bug. *** Author: burnus Date: Wed Sep 14 06:26:07 2011 New Revision: 178841 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178841 Log: 2011-09-14 Tobias Burnus <burnus@net-b.de> PR fortran/34547 PR fortran/50375 * check.c (gfc_check_null): Allow allocatables as MOLD to NULL. * resolve.c (resolve_transfer): Reject NULL without MOLD. * interface.c (gfc_procedure_use): Reject NULL without MOLD if no explicit interface is known. (gfc_search_interface): Reject NULL without MOLD if it would lead to ambiguity. 2011-09-14 Tobias Burnus <burnus@net-b.de> PR fortran/34547 PR fortran/50375 * gfortran.dg/null_5.f90: New. * gfortran.dg/null_6.f90: New. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/check.c trunk/gcc/fortran/interface.c trunk/gcc/fortran/resolve.c trunk/gcc/testsuite/ChangeLog Author: burnus Date: Wed Sep 14 06:27:25 2011 New Revision: 178842 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178842 Log: Really add: 2011-09-14 Tobias Burnus <burnus@net-b.de> PR fortran/34547 PR fortran/50375 * gfortran.dg/null_5.f90: New. * gfortran.dg/null_6.f90: New. Added: trunk/gcc/testsuite/gfortran.dg/null_5.f90 trunk/gcc/testsuite/gfortran.dg/null_6.f90 The patch fixes the issues of comment 0. However, one should go through the lengthy, convoluted thread at http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/f014195ccf7b93e6/ to check whether it contains some still-unfixed issues. > However, one should go through the lengthy, convoluted thread at > > http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/f014195ccf7b93e6/ >to check whether it contains some still-unfixed issues. The thread is too convoluted for me. Is this still an issue? It looks like it was fixed in 4.7.0 with the following error message Error: NULL intrinsic at (1) in data transfer statement requires MOLD= > It looks like it was fixed in 4.7.0 with the following error message > > Error: NULL intrinsic at (1) in data transfer statement requires MOLD= Confirmed, however compiling the second test in comment #0, namely integer, allocatable :: i(:) print *, NULL(i) end gives an ICE with 4.8.1 and trunk (4.9) pr34547_1.f90:2:0: internal compiler error: in gfc_conv_expr_descriptor, at fortran/trans-array.c:6423 print *, NULL(i) It compiles with 4.7.3, and gives the reported error with 4.6.4. (In reply to Dominique d'Humieres from comment #8) > > gives an ICE with 4.8.1 and trunk (4.9) > > pr34547_1.f90:2:0: internal compiler error: in gfc_conv_expr_descriptor, at > fortran/trans-array.c:6423 > print *, NULL(i) > > It compiles with 4.7.3, and gives the reported error with 4.6.4. ... which makes it a regression. GCC 4.8.2 has been released. (In reply to Dominique d'Humieres from comment #8) > Confirmed, however compiling the second test in comment #0, namely > > integer, allocatable :: i(:) > print *, NULL(i) > end > gives an ICE with 4.8.1 and trunk (4.9) "If an input item is a pointer, it shall be associated with a definable target and data are transferred from the file to the associated target. If an output item is a pointer, it shall be associated with a target and data are transferred from the target to the file." (F2008, "9.6.3 Data transfer input/output list") And NULL(...) isn't. Fixed by Paul's patch at http://gcc.gnu.org/ml/fortran/2013-11/msg00203.html (In reply to Tobias Burnus from comment #11) > Fixed by Paul's patch at > http://gcc.gnu.org/ml/fortran/2013-11/msg00203.html ... which has been committed to trunk as r205565. Backport pending. Author: pault Date: Sun Jan 19 11:28:44 2014 New Revision: 206772 URL: http://gcc.gnu.org/viewcvs?rev=206772&root=gcc&view=rev Log: 2014-01-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/34547 * resolve.c (resolve_transfer): EXPR_NULL is always in an invalid context in a transfer statement. 2014-01-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/34547 * gfortran.dg/null_5.f90 : Include new error. * gfortran.dg/null_6.f90 : Include new error. Modified: branches/gcc-4_8-branch/gcc/fortran/ChangeLog branches/gcc-4_8-branch/gcc/fortran/resolve.c branches/gcc-4_8-branch/gcc/testsuite/ChangeLog branches/gcc-4_8-branch/gcc/testsuite/gfortran.dg/null_5.f90 branches/gcc-4_8-branch/gcc/testsuite/gfortran.dg/null_6.f90 Finally backported to 4.8! Thanks for the report Paul |