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: "tkoenig at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 8 Jan 2011 23:35:50 +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
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tkoenig at gcc dot gnu.org
--- Comment #12 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-01-08 23:35:40 UTC ---
(In reply to comment #11)
> (In reply to comment #10)
> > Can this be closed? Is there something left to do here?
> >
> As of gfortran 4.4.4 (and 4.5.1) the program in comment #7 does not compile but
> gives the same error:
>
> Error: CHARACTER argument 'buf' to 'c_loc' at (1) must have a length of 1
This might be sufficient to fix it.
Index: resolve.c
===================================================================
--- resolve.c (Revision 168596)
+++ resolve.c (Arbeitskopie)
@@ -2547,9 +2547,7 @@ is_scalar_expr_ptr (gfc_expr *expr)
switch (ref->type)
{
case REF_SUBSTRING:
- if (ref->u.ss.length != NULL
- && ref->u.ss.length->length != NULL
- && ref->u.ss.start
+ if (ref->u.ss.start
&& ref->u.ss.start->expr_type == EXPR_CONSTANT
&& ref->u.ss.end
&& ref->u.ss.end->expr_type == EXPR_CONSTANT)