This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/38536] ICE with C_LOC in resolve.c due to not properly going through expr->ref
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 25 Jan 2011 15:44:55 +0000
- Subject: [Bug fortran/38536] ICE with C_LOC in resolve.c due to not properly going through expr->ref
- Auto-submitted: auto-generated
- References: <bug-38536-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38536
--- Comment #22 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-25 15:44:50 UTC ---
Created attachment 23121
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23121
draft patch, working but too many warnings (cf. test suite failures)
Currently
c_loc(a(1:2))
produces the warning
"Array section in '%s' call at %L"
which is correct but possibly misleading as F2008 (contrary to F2003) allows
it.
What F2008 only requires is that the argument is contiguous. At
http://gcc.gnu.org/ml/fortran/2011-01/msg00180.html
was an early (and very buggy), attached a more advanced patch which gives the
warning:
"Array might be not contiguous in '%s' call at %L"
However, the patch is also overzealous by warning for "a(1:2:5)" which is
contiguous (as equivalent to "a(1:1)"). But it also warns elsewhere too much.
I think it would be useful to only warn (or error out) if it is known to be
noncontiguous of if one cuts down the number of warnings.