public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/28890]  New: ICE on write
@ 2006-08-29 16:53 pogo_tomcat at yahoo dot com
  2006-08-29 21:26 ` [Bug fortran/28890] " pault at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: pogo_tomcat at yahoo dot com @ 2006-08-29 16:53 UTC (permalink / raw)
  To: gcc-bugs

Compiler blows up on this function.

$ cat test.f
      integer*4 function test(charr, charrlen)
      character (len=*) :: charr
      integer*4 charrlen, i
      do i=1, charrlen
         write (*,*) i, charr(i)
      end do
      end

$ gfortran -c test.f
test.f: In function 'test':
test.f:5: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
gfortran: Internal error: Bus error (program f951)
Please submit a full bug report.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

$ gfortran --version
GNU Fortran 95 (GCC) 4.2.0 20060713 (experimental)
Copyright (C) 2006 Free Software Foundation, Inc.


-- 
           Summary: ICE on write
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pogo_tomcat at yahoo dot com
 GCC build triplet: powerpc-apple-darwin8
  GCC host triplet: powerpc-apple-darwin8
GCC target triplet: powerpc-apple-darwin8


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


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

* [Bug fortran/28890] ICE on write
  2006-08-29 16:53 [Bug fortran/28890] New: ICE on write pogo_tomcat at yahoo dot com
@ 2006-08-29 21:26 ` pault at gcc dot gnu dot org
  2006-08-30  4:46 ` pault at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-08-29 21:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pault at gcc dot gnu dot org  2006-08-29 21:26 -------
Confirmed: changing the substring reference to the unambiguous
         write (*,*) i, charr(i:i)
gets rid of the problem.  Apparently, vene though charr is scalar, the
reference is being interpreted as an array reference.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-08-29 21:26:24
               date|                            |


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


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

* [Bug fortran/28890] ICE on write
  2006-08-29 16:53 [Bug fortran/28890] New: ICE on write pogo_tomcat at yahoo dot com
  2006-08-29 21:26 ` [Bug fortran/28890] " pault at gcc dot gnu dot org
@ 2006-08-30  4:46 ` pault at gcc dot gnu dot org
  2006-08-30 13:12 ` paul dot richard dot thomas at cea dot fr
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-08-30  4:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pault at gcc dot gnu dot org  2006-08-30 04:46 -------
(In reply to comment #1)
> Confirmed: changing the substring reference to the unambiguous
>          write (*,*) i, charr(i:i)
> gets rid of the problem.  Apparently, vene though charr is scalar, the
> reference is being interpreted as an array reference.
> 
> Paul
> 
Cooh! Not only was I full of bulls**t last night but had gone sydlexic too!

charr(i:i) is, of course, no more unambiguous than charr(i), except,
apparently, in the bowels of gfortran!

In fact, using -fdump-parse-tree, I find that charr(i) is being taken as a
character function reference.  It must be easy enough to put paid to that...

Paul


-- 


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


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

* [Bug fortran/28890] ICE on write
  2006-08-29 16:53 [Bug fortran/28890] New: ICE on write pogo_tomcat at yahoo dot com
  2006-08-29 21:26 ` [Bug fortran/28890] " pault at gcc dot gnu dot org
  2006-08-30  4:46 ` pault at gcc dot gnu dot org
@ 2006-08-30 13:12 ` paul dot richard dot thomas at cea dot fr
  2006-09-05 19:40 ` pault at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paul dot richard dot thomas at cea dot fr @ 2006-08-30 13:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from paul dot richard dot thomas at cea dot fr  2006-08-30 13:11 -------
(In reply to comment #2)

The standard is unambiguous: A string element must be written as charr(i:i).

character(*) :: charr
.....
print *, charr(i)

will always be interpreted as a call to an assumed character length function
charr, which is allowed if charr is a dummy function.

As to its being easy... *sigh* we'll see!

Paul 


-- 


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


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

* [Bug fortran/28890] ICE on write
  2006-08-29 16:53 [Bug fortran/28890] New: ICE on write pogo_tomcat at yahoo dot com
                   ` (2 preceding siblings ...)
  2006-08-30 13:12 ` paul dot richard dot thomas at cea dot fr
@ 2006-09-05 19:40 ` pault at gcc dot gnu dot org
  2006-09-11  5:03 ` pault at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-09-05 19:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pault at gcc dot gnu dot org  2006-09-05 19:40 -------
A patch is ready but I have not had time to post it.

Watch the list this weekend.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-08-29 21:26:24         |2006-09-05 19:40:51
               date|                            |


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


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

* [Bug fortran/28890] ICE on write
  2006-08-29 16:53 [Bug fortran/28890] New: ICE on write pogo_tomcat at yahoo dot com
                   ` (3 preceding siblings ...)
  2006-09-05 19:40 ` pault at gcc dot gnu dot org
@ 2006-09-11  5:03 ` pault at gcc dot gnu dot org
  2006-09-11  8:15 ` paul dot richard dot thomas at cea dot fr
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-09-11  5:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2006-09-11 05:03 -------
Subject: Bug 28890

Author: pault
Date: Mon Sep 11 05:02:58 2006
New Revision: 116839

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116839
Log:
2006-09-11  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/28890
        trans-expr.c (gfc_conv_function_call): Obtain the string length
        of a dummy character(*) function from the symbol if it is not
        already translated.  For a call to a character(*) function, use
        the passed, hidden string length argument, which is available
        from the backend_decl of the formal argument.
        resolve.c (resolve_function): It is an error if a function call
        to a character(*) function is other than a dummy procedure or
        an intrinsic.

2006-09-11  Paul Thomas  <pault@gcc.gnu.org>

        PR libfortran/28890
        gfortran.dg/assumed_charlen_function_5.f90: New test.




Added:
    trunk/gcc/testsuite/gfortran.dg/assumed_charlen_function_5.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/28890] ICE on write
  2006-08-29 16:53 [Bug fortran/28890] New: ICE on write pogo_tomcat at yahoo dot com
                   ` (4 preceding siblings ...)
  2006-09-11  5:03 ` pault at gcc dot gnu dot org
@ 2006-09-11  8:15 ` paul dot richard dot thomas at cea dot fr
  2006-09-12  4:37 ` pault at gcc dot gnu dot org
  2006-09-12  4:38 ` pault at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: paul dot richard dot thomas at cea dot fr @ 2006-09-11  8:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from paul dot richard dot thomas at cea dot fr  2006-09-11 08:15 -------
The patch did not apply cleanly to 4.1; I will take a look tonight to try to
understand why.

Paul


-- 


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


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

* [Bug fortran/28890] ICE on write
  2006-08-29 16:53 [Bug fortran/28890] New: ICE on write pogo_tomcat at yahoo dot com
                   ` (5 preceding siblings ...)
  2006-09-11  8:15 ` paul dot richard dot thomas at cea dot fr
@ 2006-09-12  4:37 ` pault at gcc dot gnu dot org
  2006-09-12  4:38 ` pault at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-09-12  4:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pault at gcc dot gnu dot org  2006-09-12 04:37 -------
Subject: Bug 28890

Author: pault
Date: Tue Sep 12 04:37:09 2006
New Revision: 116871

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116871
Log:
2006-09-12  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/28890
        trans-expr.c (gfc_conv_function_call): Obtain the string length
        of a dummy character(*) function from the symbol if it is not
        already translated.  For a call to a character(*) function, use
        the passed, hidden string length argument, which is available
        from the backend_decl of the formal argument.
        resolve.c (resolve_function): It is an error if a function call
        to a character(*) function is other than a dummy procedure or
        an intrinsic.

2006-09-12  Paul Thomas  <pault@gcc.gnu.org>

        PR libfortran/28890
        gfortran.dg/assumed_charlen_function_5.f90: New test.




Added:
   
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/assumed_charlen_function_5.f90
Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/resolve.c
    branches/gcc-4_1-branch/gcc/fortran/trans-expr.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/28890] ICE on write
  2006-08-29 16:53 [Bug fortran/28890] New: ICE on write pogo_tomcat at yahoo dot com
                   ` (6 preceding siblings ...)
  2006-09-12  4:37 ` pault at gcc dot gnu dot org
@ 2006-09-12  4:38 ` pault at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-09-12  4:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pault at gcc dot gnu dot org  2006-09-12 04:38 -------
Fixed on trunk and 4.1

Paul


-- 

pault at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2006-09-12  4:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-29 16:53 [Bug fortran/28890] New: ICE on write pogo_tomcat at yahoo dot com
2006-08-29 21:26 ` [Bug fortran/28890] " pault at gcc dot gnu dot org
2006-08-30  4:46 ` pault at gcc dot gnu dot org
2006-08-30 13:12 ` paul dot richard dot thomas at cea dot fr
2006-09-05 19:40 ` pault at gcc dot gnu dot org
2006-09-11  5:03 ` pault at gcc dot gnu dot org
2006-09-11  8:15 ` paul dot richard dot thomas at cea dot fr
2006-09-12  4:37 ` pault at gcc dot gnu dot org
2006-09-12  4:38 ` pault 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).