public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/24503]  New: varying string length character function result
@ 2005-10-24 12:14 r dot butel at epoc dot u-bordeaux1 dot fr
  2005-10-24 12:16 ` [Bug fortran/24503] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: r dot butel at epoc dot u-bordeaux1 dot fr @ 2005-10-24 12:14 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2747 bytes --]

* the exact version of GCC;
> gfortran -v

Utilisation des specs internes.
Target: i386-redhat-linux
Configuré avec: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,java,f95,ada --enable-java-awt=gtk
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--host=i386-redhat-linux
Modèle de thread: posix
version gcc 4.0.1 20050727 (Red Hat 4.0.1-5)

    * the system type;
> cat /proc/version
Linux version 2.6.13-1.1526_FC4smp (bhcompile@hs20-bc1-6.build.redhat.com)
(gcc version 4.0.1 20050727 (Red Hat 4.0.1-5)) #1 SMP Wed Sep 28 19:30:04 EDT
2005

    * the options given when GCC was configured/built;
> gfortran -v -save-temps -c bug.f90
GNU F95 version 4.0.1 20050727 (Red Hat 4.0.1-5) (i386-redhat-linux)
        compiled by GNU C version 4.0.1 20050727 (Red Hat 4.0.1-5).
heuristiques GGC: --param ggc-min-expand=100 --param ggc-min-heapsize=131072

    * the complete command line that triggers the bug;
gfortran -c bug.f90

    * the compiler output (error messages, warnings, etc.); and
> gfortran -c bug.f90
bug.f90: In function ‘s_to_c’:
bug.f90:21: erreur interne du compilateur: dans gfc_finish_var_decl, à
fortran/trans-decl.c:436
Veuillez soumettre un rapport complet d'anomalies,
avec le source pré-traité si nécessaire.
Consultez <URL:http://bugzilla.redhat.com/bugzilla> pour plus de détail.

    * the preprocessed file (*.i*) that triggers the bug, generated by adding
-save-temps to the complete compilation command, or, in the case of a bug
report for the GNAT front end, a complete set of source files (see below).
> cat bug.f90
MODULE ISO_VARYING_STRING

PRIVATE

TYPE VARYING_STRING
 PRIVATE
 CHARACTER,DIMENSION(:),POINTER :: chars
ENDTYPE VARYING_STRING

CHARACTER,PARAMETER :: blank = " "

PUBLIC :: s_to_c

CONTAINS

 FUNCTION s_to_c(string)
  type(VARYING_STRING),INTENT(IN)   :: string
  ! returns the characters of string as an automatically sized character
  CHARACTER(LEN=SIZE(string%chars)) :: s_to_c
  INTEGER                           :: lc
  lc=SIZE(string%chars)
  DO i=1,lc
    s_to_c(i:i) = string%chars(i)
  ENDDO
 ENDFUNCTION s_to_c

END MODULE ISO_VARYING_STRING


-- 
           Summary: varying string length character function result
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: r dot butel at epoc dot u-bordeaux1 dot fr


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


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

* [Bug fortran/24503] varying string length character function result
  2005-10-24 12:14 [Bug fortran/24503] New: varying string length character function result r dot butel at epoc dot u-bordeaux1 dot fr
@ 2005-10-24 12:16 ` pinskia at gcc dot gnu dot org
  2005-10-24 12:53 ` erik dot edelmann at iki dot fi
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-24 12:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2005-10-24 12:16 -------
Here is what I get with the mainline of GCC:
 In file t.f90:12

PUBLIC :: s_to_c
               1
Error: 'string' is a PRIVATE type and cannot be a dummy argument of 's_to_c',
which is PUBLIC at (1)


-- 


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


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

* [Bug fortran/24503] varying string length character function result
  2005-10-24 12:14 [Bug fortran/24503] New: varying string length character function result r dot butel at epoc dot u-bordeaux1 dot fr
  2005-10-24 12:16 ` [Bug fortran/24503] " pinskia at gcc dot gnu dot org
@ 2005-10-24 12:53 ` erik dot edelmann at iki dot fi
  2005-10-24 13:56 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: erik dot edelmann at iki dot fi @ 2005-10-24 12:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from erik dot edelmann at iki dot fi  2005-10-24 12:53 -------
(In reply to comment #1)
> Here is what I get with the mainline of GCC:
>  In file t.f90:12
> 
> PUBLIC :: s_to_c
>                1
> Error: 'string' is a PRIVATE type and cannot be a dummy argument of 's_to_c',
> which is PUBLIC at (1)

Gfortran is correct; the code is invalid.  However, if we make it valid by
declaring the type VARYING_STRING public too, we get the error message
of the OP.  Here's a reduced testcase

kl-nrb:~$ cat hum.f90
MODULE ISO_VARYING_STRING

CONTAINS

 FUNCTION s_to_c(chars)
  CHARACTER,DIMENSION(:),POINTER :: chars
  CHARACTER(LEN=SIZE(chars)) :: s_to_c
  s_to_c = ''
 ENDFUNCTION s_to_c

END MODULE ISO_VARYING_STRING
kl-nrb:~$ gfortran hum.f90
hum.f90: In function 's_to_c':
hum.f90:5: internal compiler error: in gfc_finish_var_decl, at
fortran/trans-decl.c:444
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

I think I've seen this bug reported somewhere, but couldn't find it in a quick
search.


-- 

erik dot edelmann at iki dot fi changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |erik dot edelmann at iki dot
                   |                            |fi


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


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

* [Bug fortran/24503] varying string length character function result
  2005-10-24 12:14 [Bug fortran/24503] New: varying string length character function result r dot butel at epoc dot u-bordeaux1 dot fr
  2005-10-24 12:16 ` [Bug fortran/24503] " pinskia at gcc dot gnu dot org
  2005-10-24 12:53 ` erik dot edelmann at iki dot fi
@ 2005-10-24 13:56 ` pinskia at gcc dot gnu dot org
  2005-10-24 16:31 ` eedelman at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-24 13:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2005-10-24 13:56 -------
(In reply to comment #2)
> I think I've seen this bug reported somewhere, but couldn't find it in a quick
> search.
Looks to be PR 23675.


-- 


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


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

* [Bug fortran/24503] varying string length character function result
  2005-10-24 12:14 [Bug fortran/24503] New: varying string length character function result r dot butel at epoc dot u-bordeaux1 dot fr
                   ` (2 preceding siblings ...)
  2005-10-24 13:56 ` pinskia at gcc dot gnu dot org
@ 2005-10-24 16:31 ` eedelman at gcc dot gnu dot org
  2005-10-27  9:25 ` erik dot edelmann at iki dot fi
  2005-10-27 10:26 ` eedelman at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: eedelman at gcc dot gnu dot org @ 2005-10-24 16:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from eedelman at gcc dot gnu dot org  2005-10-24 16:31 -------
(In reply to comment #3)
> (In reply to comment #2)
> > I think I've seen this bug reported somewhere, but couldn't find it in a quick
> > search.
> Looks to be PR 23675.

Yes, they seem to be the same, except that PR 23675 demonstrates an other bug
as well, namely the same one as in PR 22607.

I confirm this bug, and mark it as blocking PR 23675, and will do the same with
PR 22607 (another possibility would be to mark both this and PR 22607 as
duplicates of PR 23675, but since they are separate bugs I think there is some
value in keeping them as separate PR:s)


-- 

eedelman at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |23675
              nThis|                            |
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-10-24 16:31:43
               date|                            |


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


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

* [Bug fortran/24503] varying string length character function result
  2005-10-24 12:14 [Bug fortran/24503] New: varying string length character function result r dot butel at epoc dot u-bordeaux1 dot fr
                   ` (3 preceding siblings ...)
  2005-10-24 16:31 ` eedelman at gcc dot gnu dot org
@ 2005-10-27  9:25 ` erik dot edelmann at iki dot fi
  2005-10-27 10:26 ` eedelman at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: erik dot edelmann at iki dot fi @ 2005-10-27  9:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from erik dot edelmann at iki dot fi  2005-10-27 09:25 -------
Patch here: http://gcc.gnu.org/ml/fortran/2005-10/msg00587.html


-- 


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


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

* [Bug fortran/24503] varying string length character function result
  2005-10-24 12:14 [Bug fortran/24503] New: varying string length character function result r dot butel at epoc dot u-bordeaux1 dot fr
                   ` (4 preceding siblings ...)
  2005-10-27  9:25 ` erik dot edelmann at iki dot fi
@ 2005-10-27 10:26 ` eedelman at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: eedelman at gcc dot gnu dot org @ 2005-10-27 10:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from eedelman at gcc dot gnu dot org  2005-10-27 10:26 -------


*** This bug has been marked as a duplicate of 18883 ***


-- 

eedelman at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2005-10-27 10:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-24 12:14 [Bug fortran/24503] New: varying string length character function result r dot butel at epoc dot u-bordeaux1 dot fr
2005-10-24 12:16 ` [Bug fortran/24503] " pinskia at gcc dot gnu dot org
2005-10-24 12:53 ` erik dot edelmann at iki dot fi
2005-10-24 13:56 ` pinskia at gcc dot gnu dot org
2005-10-24 16:31 ` eedelman at gcc dot gnu dot org
2005-10-27  9:25 ` erik dot edelmann at iki dot fi
2005-10-27 10:26 ` eedelman 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).