public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/35952]  New: Segmentation fault with character strings only when compiling with -funroll-loops and -O3
@ 2008-04-16  5:34 john dot young at jrc dot co dot jp
  2008-04-16  5:35 ` [Bug fortran/35952] " john dot young at jrc dot co dot jp
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: john dot young at jrc dot co dot jp @ 2008-04-16  5:34 UTC (permalink / raw)
  To: gcc-bugs

I attached a short code that produces segmentation faults (or strange cygwin
errors).  The segmentation faults only occur when compiling with both
-funroll-loops and -O3.  If one or the other or neither are used, the program
runs fine.  The code has several examples.  I attached a stackdump for the case
of the three write statements.

System : WinXP, cygwin, gcc version 4.3.0 20080212 (experimental)

==============================
subroutine test_sub(label)

character(len=*),intent(in) :: label

character (len=(len(label)+20)) :: c1
character (len=(len(label)+20)) :: c2
character (len=(len(label)+20)) :: c3

! the below 3 lines cause a segmentation fault
!  print*, len(c1)
!  print*, len(c2)
!  print*, len(c3)

! the below 2 lines produce strange cygwin errors
!          a ### sig_send: wait for sig_complete event failed, signal -34, rc
-1, Win32 error 6
!  print*, len(c1)
!  print*, len(c2)

! the below 1 lines produces no problem
!  print*, len(c3)

! the below 3 lines cause a segmentation fault (I gave the stackdump for this
case)
  write(c1,'(A)') 'a'
  write(c2,'(A)') 'b'
  write(c3,'(A)') 'c'

! the below 2 lines produce strange cygwin erros
!          a ### sig_send: wait for sig_complete event failed, signal -34, rc
-1, Win32 error 6
!  write(c1,'(A)') 'a'
!  write(c2,'(A)') 'b'

! the below 1 lines produces no problem
!  write(c1,'(A)') 'a'

end subroutine test_sub
!======================
program test

  call test_sub('a')
  print*, 'done'

end program test
!======================


-- 
           Summary: Segmentation fault with character strings only when
                    compiling with -funroll-loops and -O3
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: john dot young at jrc dot co dot jp
GCC target triplet: i686-pc-cywgin


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


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

end of thread, other threads:[~2009-10-14  1:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-16  5:34 [Bug fortran/35952] New: Segmentation fault with character strings only when compiling with -funroll-loops and -O3 john dot young at jrc dot co dot jp
2008-04-16  5:35 ` [Bug fortran/35952] " john dot young at jrc dot co dot jp
2008-04-16  5:35 ` john dot young at jrc dot co dot jp
2008-04-16 18:16 ` tkoenig at gcc dot gnu dot org
2008-08-08 21:45 ` jv244 at cam dot ac dot uk
2008-11-01 12:48 ` jvdelisle at gcc dot gnu dot org
2009-03-28 13:06 ` fxcoudert at gcc dot gnu dot org
2009-10-04 21:25 ` jvdelisle at gcc dot gnu dot org
2009-10-14  1:10 ` jvdelisle at gcc dot gnu dot org
2009-10-14  1:49 ` jvdelisle 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).