public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/13251] New: wrong error: character kind=0 not available
@ 2003-12-01  2:15 dann at godzilla dot ics dot uci dot edu
  2003-12-01  2:19 ` [Bug fortran/13251] [gfortran] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2003-12-01  2:15 UTC (permalink / raw)
  To: gcc-bugs

With: gcc version 3.5-tree-ssa 20031130 (merged 20031123)


mymod.f90:
      MODULE  mymod
                                                                        
      TYPE :: mymod_type                                                
        CHARACTER(32)            MYFIELD
      END TYPE                                                          
                                                                        
      TYPE (mymod_type), DIMENSION(:), ALLOCATABLE :: MYMOD_VALUE
                                                                        
      END MODULE mymod

test.f90:

SUBROUTINE MYSUB (MYARG)
  USE mymod
  K = INDEX(MYMOD_VALUE(1)%MYFIELD(1:32)," ")
  RETURN
END SUBROUTINE MYSUB



gfortran -c test.f90
test.f90: In function `mysub':

test.f90:3: fatal error: character kind=0 not available
compilation terminated.

Intel's compiler compiles the above code.

Code like this appears in SPEC2000

-- 
           Summary: wrong error: character kind=0 not available
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13251


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/13251] [gfortran] wrong error: character kind=0 not available
  2003-12-01  2:15 [Bug fortran/13251] New: wrong error: character kind=0 not available dann at godzilla dot ics dot uci dot edu
@ 2003-12-01  2:19 ` pinskia at gcc dot gnu dot org
  2003-12-02 15:53 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-01  2:19 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
            Summary|wrong error: character      |[gfortran] wrong error:
                   |kind=0 not available        |character kind=0 not
                   |                            |available
   Target Milestone|---                         |tree-ssa


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13251


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/13251] [gfortran] wrong error: character kind=0 not available
  2003-12-01  2:15 [Bug fortran/13251] New: wrong error: character kind=0 not available dann at godzilla dot ics dot uci dot edu
  2003-12-01  2:19 ` [Bug fortran/13251] [gfortran] " pinskia at gcc dot gnu dot org
@ 2003-12-02 15:53 ` pinskia at gcc dot gnu dot org
  2003-12-05 10:09 ` steven at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-02 15:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-02 15:53 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-12-02 15:53:35
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13251


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/13251] [gfortran] wrong error: character kind=0 not available
  2003-12-01  2:15 [Bug fortran/13251] New: wrong error: character kind=0 not available dann at godzilla dot ics dot uci dot edu
  2003-12-01  2:19 ` [Bug fortran/13251] [gfortran] " pinskia at gcc dot gnu dot org
  2003-12-02 15:53 ` pinskia at gcc dot gnu dot org
@ 2003-12-05 10:09 ` steven at gcc dot gnu dot org
  2003-12-05 12:17 ` steven at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: steven at gcc dot gnu dot org @ 2003-12-05 10:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2003-12-05 10:08 -------
Lemme start by saying that whatever the Intel Fortran compiler compiles is not 
necessarily valid Fortran.  In fact their compiler is notoriously buggy and 
non-conformant.  Oh well... 
 
This bug is of course real.  At first I thought, "characters and modules, so 
probably a known bug".  But it seems that we're just not propagating the kind 
of a derived type field to the expression, as demonstrated by the following 
reduced test case: 
 
------------------------------------- 
type :: foo 
  character(32) :: bar 
end type 
 
type (foo) :: tmp 
character(32) :: t 
 
t = tmp%bar(1:32) 
end 
------------------------------------- 
 
So this is a type resolution problem.  I'm looking into this... 
 
BTW, the error you get here is not really a "wrong error".  It's more like an 
internal compiler error.  The error is issued from one of the trans-* files, 
which expect a fully resolved and finished Fortran "compilation unit".  
Anything that fails after this is in fact an ICE, so we should probably use 
"internal_error" instead of "fatal_error"... 
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2003-12-02 15:53:35         |2003-12-05 10:09:02
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13251


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/13251] [gfortran] wrong error: character kind=0 not available
  2003-12-01  2:15 [Bug fortran/13251] New: wrong error: character kind=0 not available dann at godzilla dot ics dot uci dot edu
                   ` (2 preceding siblings ...)
  2003-12-05 10:09 ` steven at gcc dot gnu dot org
@ 2003-12-05 12:17 ` steven at gcc dot gnu dot org
  2004-01-01 12:25 ` cvs-commit at gcc dot gnu dot org
  2004-01-01 12:29 ` pbrook at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: steven at gcc dot gnu dot org @ 2003-12-05 12:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2003-12-05 12:17 -------
Proposed patch in http://gcc.gnu.org/ml/fortran/2003-12/msg00022.html 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13251


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/13251] [gfortran] wrong error: character kind=0 not available
  2003-12-01  2:15 [Bug fortran/13251] New: wrong error: character kind=0 not available dann at godzilla dot ics dot uci dot edu
                   ` (3 preceding siblings ...)
  2003-12-05 12:17 ` steven at gcc dot gnu dot org
@ 2004-01-01 12:25 ` cvs-commit at gcc dot gnu dot org
  2004-01-01 12:29 ` pbrook at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-01-01 12:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-01-01 12:25 -------
Subject: Bug 13251

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	tree-ssa-20020619-branch
Changes by:	pbrook@gcc.gnu.org	2004-01-01 12:25:42

Modified files:
	gcc/fortran    : ChangeLog trans-expr.c 

Log message:
	PR fortran/13251
	* trans-expr.c (gfc_conv_variable): Take the type kind of a substring
	reference from the expression.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.99&r2=1.1.2.100
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-expr.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.16&r2=1.1.2.17



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13251


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/13251] [gfortran] wrong error: character kind=0 not available
  2003-12-01  2:15 [Bug fortran/13251] New: wrong error: character kind=0 not available dann at godzilla dot ics dot uci dot edu
                   ` (4 preceding siblings ...)
  2004-01-01 12:25 ` cvs-commit at gcc dot gnu dot org
@ 2004-01-01 12:29 ` pbrook at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pbrook at gcc dot gnu dot org @ 2004-01-01 12:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pbrook at gcc dot gnu dot org  2004-01-01 12:29 -------
Fixed. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13251


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-01-01 12:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-01  2:15 [Bug fortran/13251] New: wrong error: character kind=0 not available dann at godzilla dot ics dot uci dot edu
2003-12-01  2:19 ` [Bug fortran/13251] [gfortran] " pinskia at gcc dot gnu dot org
2003-12-02 15:53 ` pinskia at gcc dot gnu dot org
2003-12-05 10:09 ` steven at gcc dot gnu dot org
2003-12-05 12:17 ` steven at gcc dot gnu dot org
2004-01-01 12:25 ` cvs-commit at gcc dot gnu dot org
2004-01-01 12:29 ` pbrook at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).