public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/19574] New: specification expression failure
@ 2005-01-22 11:49 coudert at clipper dot ens dot fr
  2005-01-25 10:57 ` [Bug fortran/19574] " paulthomas2 at wanadoo dot fr
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: coudert at clipper dot ens dot fr @ 2005-01-22 11:49 UTC (permalink / raw)
  To: gcc-bugs

The following code (from
http://home.comcast.net/~kmbtib/gfortran_bugs/REF_JVB_GFTN_005.html) fails in
the following way (on i686-mingw and powerpc-apple-darwin):

---------------------------------
module funcs
   implicit none
   contains
      function f(x)
         character(*), intent(in) :: x
         integer f(len(x))
         integer i

!         do i=1,len(x)
!           f(i) = 0
!         end do
      end function f
end module funcs

program spec_expr_test
   use funcs
   implicit none

   write(*,*) size(f('test'))
end program spec_expr_test
---------------------------------

$ gfortran reduced_spec.f90 && ./a.out 
reduced_spec.f90: In function 'f':
reduced_spec.f90:4: warning: Function does not return a value
At line 19 of file reduced_spec.f90
Fortran runtime error: Internal: Possible double free of temporary.


If you uncomment the three lines in the code above, you get a runtime segfault
(on powerpc-apple-darwin):

$ gfortran reduced_spec.f90 && ./a.out
zsh: bus error  ./a.out


I don't know if these two issues are related, but I post them both in one PR
just in case they can be debuggued altogether.

-- 
           Summary: specification expression failure
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: coudert at clipper dot ens dot fr
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug fortran/19574] specification expression failure
  2005-01-22 11:49 [Bug fortran/19574] New: specification expression failure coudert at clipper dot ens dot fr
@ 2005-01-25 10:57 ` paulthomas2 at wanadoo dot fr
  2005-06-06  0:33 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: paulthomas2 at wanadoo dot fr @ 2005-01-25 10:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From paulthomas2 at wanadoo dot fr  2005-01-25 10:57 -------
The segmentation fault seems to me to have the same source as PR19561 - 
temporaries are not being allocated/assigned properly.

This does the first wriet OK and then seg faults on the second:

! { dg-do run }
module funcs
   implicit none
   contains
      function f (x)
         character(*), intent(in) :: x
         integer f(len(x))
	 f = 0
      end function f
end module funcs
program spec_expr_test
   use funcs
   implicit none
   integer, dimension(10)  :: i
   i(1:5) = f ('test')
   write (*,*) i(1:5)
   write (*,*) f('untest')
end program spec_expr_test
! { dg-error "Segmentation fault (core dumped)" }


-- 


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


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

* [Bug fortran/19574] specification expression failure
  2005-01-22 11:49 [Bug fortran/19574] New: specification expression failure coudert at clipper dot ens dot fr
  2005-01-25 10:57 ` [Bug fortran/19574] " paulthomas2 at wanadoo dot fr
@ 2005-06-06  0:33 ` pinskia at gcc dot gnu dot org
  2005-06-06  0:34 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-06  0:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-06 00:33 -------
Fixed in 4.0.1.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.1


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


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

* [Bug fortran/19574] specification expression failure
  2005-01-22 11:49 [Bug fortran/19574] New: specification expression failure coudert at clipper dot ens dot fr
  2005-01-25 10:57 ` [Bug fortran/19574] " paulthomas2 at wanadoo dot fr
  2005-06-06  0:33 ` pinskia at gcc dot gnu dot org
@ 2005-06-06  0:34 ` pinskia at gcc dot gnu dot org
  2005-06-13  3:28 ` pinskia at gcc dot gnu dot org
  2005-09-18  5:42 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-06  0:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-06 00:33 -------
Reopening for now, I think I read comment # 1 wrong.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |
   Target Milestone|4.0.1                       |---


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


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

* [Bug fortran/19574] specification expression failure
  2005-01-22 11:49 [Bug fortran/19574] New: specification expression failure coudert at clipper dot ens dot fr
                   ` (2 preceding siblings ...)
  2005-06-06  0:34 ` pinskia at gcc dot gnu dot org
@ 2005-06-13  3:28 ` pinskia at gcc dot gnu dot org
  2005-09-18  5:42 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-13  3:28 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEW


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


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

* [Bug fortran/19574] specification expression failure
  2005-01-22 11:49 [Bug fortran/19574] New: specification expression failure coudert at clipper dot ens dot fr
                   ` (3 preceding siblings ...)
  2005-06-13  3:28 ` pinskia at gcc dot gnu dot org
@ 2005-09-18  5:42 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-18  5:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-18 05:42 -------
the testcase in comment #1 no longer seg faults.

-- 


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


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

* [Bug fortran/19574] specification expression failure
       [not found] <bug-19574-10259@http.gcc.gnu.org/bugzilla/>
  2005-12-15 14:50 ` paul dot richard dot thomas at cea dot fr
@ 2006-01-02  7:16 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-02  7:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2006-01-02 07:16 -------
(In reply to comment #6)
> I will close this tonight

This never happened so I am closing it right now as fixed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.1.0


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



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

* [Bug fortran/19574] specification expression failure
       [not found] <bug-19574-10259@http.gcc.gnu.org/bugzilla/>
@ 2005-12-15 14:50 ` paul dot richard dot thomas at cea dot fr
  2006-01-02  7:16 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 8+ messages in thread
From: paul dot richard dot thomas at cea dot fr @ 2005-12-15 14:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from paul dot richard dot thomas at cea dot fr  2005-12-15 14:49 -------
(In reply to comment #5)
> the testcase in comment #1 no longer seg faults.

module funcs
   implicit none
   contains
      function f(x)
         character(*), intent(in) :: x
         integer f(len(x))
         integer i

         do i=1,len(x)
            f(i) = iachar (x(i:i))
         end do

      end function f
end module funcs

program spec_expr_test
   use funcs
   implicit none

   write(*,*) f('test')
end program spec_expr_test

now compiles and runs correctly, as does my testcase.

I will close this tonight


-- 


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


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

end of thread, other threads:[~2006-01-02  7:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-22 11:49 [Bug fortran/19574] New: specification expression failure coudert at clipper dot ens dot fr
2005-01-25 10:57 ` [Bug fortran/19574] " paulthomas2 at wanadoo dot fr
2005-06-06  0:33 ` pinskia at gcc dot gnu dot org
2005-06-06  0:34 ` pinskia at gcc dot gnu dot org
2005-06-13  3:28 ` pinskia at gcc dot gnu dot org
2005-09-18  5:42 ` pinskia at gcc dot gnu dot org
     [not found] <bug-19574-10259@http.gcc.gnu.org/bugzilla/>
2005-12-15 14:50 ` paul dot richard dot thomas at cea dot fr
2006-01-02  7:16 ` pinskia 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).