[Bug libfortran/95293] New: Fortran not passing array by reference

2020-05-23 Thread david.sagan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95293

Bug ID: 95293
   Summary: Fortran not passing array by reference
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libfortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: david.sagan at gmail dot com
  Target Milestone: ---

The test program is:

program test
implicit none

type cb_struct
  real :: cbar = 0
end type

type scratch_struct
  type (cb_struct) :: cc(10)
  real :: zz(10) = 0
end type

type (scratch_struct), target :: s1

!

s1%cc(2)%cbar = 7
call sub2(s1%cc%cbar)
print *, 'Sub2 result:', s1%cc(2)%cbar, '  ! Wrong. Should be 10'

s1%zz(2) = 7
call sub3(s1%zz)
print *, 'Sub3 result:', s1%zz(2)

!--
contains

subroutine sub2(vec)
  real, target, intent(inout) :: vec(:)
  real, pointer :: ptr
  ptr => vec(1)
  print *, 'In sub2:', associated(ptr, s1%cc(1)%cbar), vec(2)
  vec(2) = 23
  s1%cc(2)%cbar = 10
end subroutine sub2

subroutine sub3(vec)
  real, target, intent(inout) :: vec(:)
  real, pointer :: ptr
  ptr => vec(1)
  print *, 'In sub3:', associated(ptr, s1%zz(1)), vec(2)
  vec(2) = 23
  s1%zz(2) = 10
end subroutine sub3

end program


Running gives:

> gfortran test.f90
> ./a.out 
 In sub2: F   7.
 Sub2 result:   23.000   ! Wrong. Should be 10
 In sub3: T   7.
 Sub3 result:   10.000

I get the same result on Linux and Mac with gcc 8.3.1 and gcc 9.3.

[Bug libfortran/95293] Fortran not passing array by reference

2020-05-23 Thread david.sagan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95293

--- Comment #2 from David Sagan  ---
The gcc documentation says:

‘array-temps’
Warns at run time when for passing an actual argument a temporary array had to
be generated. The information generated by this warning is sometimes useful in
optimization, in order to avoid such temporaries.

But a temporary array does not have to be created in this example. The ifort
compiler does not do this.

[Bug libfortran/95293] Fortran not passing array by reference

2020-05-24 Thread david.sagan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95293

--- Comment #6 from David Sagan  ---
> program foo
>real x
>x = 42
>call bar(x)
>print *, x
>contains
>  subroutine bar(a)
> real, intent(inout) :: a
> a = 12
> x = 0
>  end subroutine bar
> end program foo
> 
> Should this print 12 or 0?  When bar returns 'a' has a value of
> 12, should this value be transferred to 'x' before the print 
> statement is executed?

'a' is passed by reference. Therefore, when the statement 'x = 0' is executed,
the value of 'a' immediately changes to 0. So '0' will be printed.

[Bug fortran/82086] namelist read with repeat count fails when item is member of array of structures

2020-02-03 Thread david.sagan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82086

David Sagan  changed:

   What|Removed |Added

 CC||david.sagan at gmail dot com

--- Comment #12 from David Sagan  ---
Still failing in 9.2.0

[Bug fortran/56378] New: gfortran internal compiler error

2013-02-18 Thread david.sagan at gmail dot com


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



 Bug #: 56378

   Summary: gfortran internal compiler error

Classification: Unclassified

   Product: gcc

   Version: 4.7.2

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: fortran

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: david.sa...@gmail.com





1) Unpack and cd to the attached directory



2) Run the "doit" script. The result is:



DCS:erpsim1:~/dcs/bmad_distribution/bmad_dist/bad> gfortran --version

GNU Fortran (GCC) 4.6.2

Copyright (C) 2011 Free Software Foundation, Inc.



DCS:erpsim1:~/dcs/bmad_distribution/bmad_dist/bad> ./doit

compiling: precision_def.f90

compiling: bmad_struct.f90

compiling: fortran_cpp_utils.f90

compiling: bmad_cpp_convert_mod.f90

bmad_cpp_convert_mod.f90: In function 'lat_to_c':

bmad_cpp_convert_mod.f90:5622:0: internal compiler error: Segmentation fault

Please submit a full bug report,

with preprocessed source if appropriate.

See  for instructions.





This bug also appears with 4.6.3 and 4.7.2 (GNU Fortran (MacPorts gcc47

4.7.2_2). I have reproduced this bug on Linux and Mac.


[Bug fortran/56378] gfortran internal compiler error

2013-02-18 Thread david.sagan at gmail dot com


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



--- Comment #2 from David Sagan  2013-02-18 
16:34:30 UTC ---

Created attachment 29483

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29483

3 *.f90 files and script to run them


[Bug fortran/56378] gfortran internal compiler error

2013-02-18 Thread david.sagan at gmail dot com


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



--- Comment #3 from David Sagan  2013-02-18 
16:36:14 UTC ---

Somehow the attachment did not get sent with the initial writeup Now it is

downloaded.



(In reply to comment #1)

> (In reply to comment #0)

> > 1) Unpack and cd to the attached directory

> > 

> 

> There's no attachment.


[Bug fortran/51904] New: Internal Compiler Error on size function evaluation

2012-01-19 Thread david.sagan at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51904

 Bug #: 51904
   Summary: Internal Compiler Error on size function evaluation
Classification: Unclassified
   Product: gcc
   Version: 4.6.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: david.sa...@gmail.com


The following program produces an "internal compiler error" in 4.6.3. gcc 4.5
does not show the bug:

subroutine qp_draw_polyline_basic (x)
  implicit none
  real :: x(:), f
  f = 0
  print *, size(f*x)
end subroutine

Result:

mc66:~/Bmad/bmad_dist/bug> uname -a
Darwin mc66.lns.cornell.edu 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7
16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386

mc66:~/Bmad/bmad_dist/bug> gfortran --version
GNU Fortran (GCC) 4.6.2

mc66:~/Bmad/bmad_dist/bug> gfortran -c bug.f90
f951: internal compiler error: Segmentation fault

Of course the workaround is easy: Just replace "size(f*x)" with "size(x)".


[Bug fortran/84495] New: Incorrect result for concatenation of Fortran allocatable string

2018-02-20 Thread david.sagan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84495

Bug ID: 84495
   Summary: Incorrect result for concatenation of Fortran
allocatable string
   Product: gcc
   Version: 7.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: david.sagan at gmail dot com
  Target Milestone: ---

Using gfortran 7.3.0:

Davids-Mac-mini:~/Bmad> gfortran --version
GNU Fortran (MacPorts gcc7 7.3.0_0) 7.3.0


Test program is:

program test
character(:), allocatable :: str
allocate(character(3) :: str)
str = '123456789'
print *, str
str = str(1:3) // 'A' // str(6:)
print *, str
end program


Running gives:

Davids-Mac-mini:~/Bmad> gfortran test.f90
Davids-Mac-mini:~/Bmad> ./a.out 
 123456789
 123A678 

Notice that the second line is missing a "9" at the end. That is, it should be
"123A6789".

[Bug fortran/87568] New: Gfortran compile fails with bogus error message.

2018-10-09 Thread david.sagan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87568

Bug ID: 87568
   Summary: Gfortran compile fails with bogus error message.
   Product: gcc
   Version: 8.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: david.sagan at gmail dot com
  Target Milestone: ---

consider the following test program:

subroutine tao_show_this ()
implicit none

type b_struct
  integer, pointer :: good_user => null()
end type

type a_struct
  type (b_struct), allocatable :: value_ptr(:)
end type

type (a_struct) a

a = a_struct()
end subroutine


Compiling gives:

> gfortran -c test.f90
test.f90:4:13:

 type b_struct
 1
Error: The rank of the element in the structure constructor at (1) does not
match that of the component (0/1)

I believe this error message is bogus. Ifort will compile this code without
error. 

Note: This code will compile if modified in a number of ways:
1) Replace "value_ptr(:)" with "value_ptr" as the allocatable component of
a_struct.
2) Replace "integer, pointer :: good_user => null()" with "integer :: good_user
= 0" as the component of b_struct.
3) Replace "a = a_struct()" with "a = a_struct(null())".

[Bug fortran/81978] New: Passing component of a parameter array to a subroutine causes SIGBUS crash

2017-08-24 Thread david.sagan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81978

Bug ID: 81978
   Summary: Passing component of a parameter array to a subroutine
causes SIGBUS crash
   Product: gcc
   Version: 7.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: david.sagan at gmail dot com
  Target Milestone: ---

Consider the following program:

module test_mod
contains
subroutine match_word (names)
implicit none
character(*) names(:)
end subroutine
end module

program test
use test_mod
implicit none

type pp_struct
  character(40) name
  real value
end type

type (pp_struct), parameter :: pp(2) = [ &
 pp_struct('pi', 3.1), &
 pp_struct('twopi', 6.3)]

print *, 'In'
call match_word(pp%name)
print *, 'Out'
end program



Compiling and running produces:

Davids-Mac-mini:~/Downloads> gfortran test.f90; ./a.out 
 In

Program received signal SIGBUS: Access to an undefined portion of a memory
object.

Backtrace for this error:
#0  0x105ff50bc
#1  0x105ff48aa
#2  0x7fffb3bd6b39
#3  0x105fecd68
#4  0x105fece2e
Bus error: 10

Note: If "parameter" is not used with the pp array, the program runs fine.

Davids-Mac-mini:~/Downloads> gcc --version
gcc (MacPorts gcc7 7-20170622_1) 7.1.1 20170622

[Bug fortran/80965] New: ICE with class argument and -O2 optimization

2017-06-03 Thread david.sagan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80965

Bug ID: 80965
   Summary: ICE with class argument and -O2 optimization
   Product: gcc
   Version: 7.0.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: david.sagan at gmail dot com
  Target Milestone: ---

Consider the code:

module mode3_mod
contains
subroutine xyz(loc)
implicit none
class(*) :: loc
real X(6)
integer ix_use
select type (loc)
type is (integer)
  x = 0
type is (real)
  ix_use = 0
end select
end subroutine xyz
end module mode3_mod


Compiling with -O2 optimization gives an error:

Davids-Mac-mini:~/Bmad/test> gfortran -c -O2 mode3_mod.f90
mode3_mod.f90:24:0:
 end subroutine xyz
internal compiler error: in compare_values_warnv, at tree-vrp.c:1223
mode3_mod.f90:24:0: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)


I am running on a Mac (10.12.5) with gcc version:
  gcc (MacPorts gcc7 7-20170420_0) 7.0.1 20170420 (prerelease)

[Bug fortran/79060] New: gfortran ICE with deferred-length character component initialization

2017-01-11 Thread david.sagan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79060

Bug ID: 79060
   Summary: gfortran ICE with deferred-length character component
initialization
   Product: gcc
   Version: 5.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: david.sagan at gmail dot com
  Target Milestone: ---

Test program is:

program test
type my_type
  character(:), allocatable :: c
end type
type (my_type) var
var = my_type()
end program

Compiler:
mc66:~/Bmad/test> gcc --version
gcc (MacPorts gcc5 5.4.0_0) 5.4.0

Compiling gives:

mc66:~/Bmad/test> gfortran test.f90
test.f90:9:0:

 var = my_type()
 1
internal compiler error: in
alloc_scalar_allocatable_for_subcomponent_assignment, at
fortran/trans-expr.c:6842

test.f90:9:0: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)

Note: No bug with gcc 6.3.0

[Bug fortran/49025] gfortran bug: Local variable does not hide generic procedure.

2017-01-24 Thread david.sagan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49025

--- Comment #2 from David Sagan  ---
Bug present in 5.3.1

[Bug fortran/49025] New: gfortran bug: Local variable does not hide generic procedure.

2011-05-17 Thread david.sagan at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49025

   Summary: gfortran bug: Local variable does not hide generic
procedure.
   Product: gcc
   Version: 4.5.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: david.sa...@gmail.com


Consider the following test code:

---

module test

interface kick
  subroutine a_kick
  end subroutine
end interface

contains

subroutine my_sub
  implicit none
  integer kick
  call some_sub(kick)
end subroutine

end module

--
Compiling gives:

lnx4103:~/dcs/bmad_distribution/test_build> gfortran --version
GNU Fortran (GCC) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc.

lnx4103:~/dcs/bmad_distribution/test_build> gfortran -c test.f90
test.f90:13.16:

  call some_sub(kick)
1
Error: GENERIC procedure 'kick' is not allowed as an actual argument at (1)


The local "kick" variable is not hiding the "kick" generic procedure. 
This code compiles with ifort v9 and v12.


[Bug fortran/46339] New: Internal compiler error

2010-11-06 Thread david.sagan at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46339

   Summary: Internal compiler error
   Product: gcc
   Version: 4.5.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: david.sa...@gmail.com


The test program is:


module tao_graph_setup_mod

type coor_struct
  real :: vec(6)
end type

type particle_struct
  type (coor_struct) r 
end type

contains

!-

subroutine tao_phase_space_axis (p, axis)

type (particle_struct), optional, target :: p(:)
real, pointer, optional :: axis(:)

axis => p%r%vec(1)

end subroutine tao_phase_space_axis

end module



Running the program gives:

~/bmad/bmad_dist/test> gfortran err.f90
err.f90: In function 'tao_phase_space_axis':
err.f90:15:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

~/bmad/bmad_dist/test> gfortran --version
GNU Fortran (GCC) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc.

~/bmad/bmad_dist/test> uname -a
Darwin David-Sagans-Mac-mini.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr
23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386


[Bug fortran/46339] [4.3/4.4/4.5/4.6 Regression] ICE (segfault) in gfc_trans_pointer_assignment

2010-11-19 Thread david.sagan at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46339

--- Comment #20 from david.sagan at gmail dot com 2010-11-19 20:46:36 UTC ---
(In reply to comment #19)

> Is there something invalid here?
>   ptr = myA%i%j

Yes this is not correct. This line should be:
  ptr => myA%i%j

If you use "gfortran -fcheck=all test.f90" then what you get when you run the
program is:

At line 19 of file test.f90
Fortran runtime error: Array bound mismatch for dimension 1 of array 'ptr'
(140736642904848/4)


[Bug fortran/46339] [4.3/4.4/4.5/4.6 Regression] ICE (segfault) in gfc_trans_pointer_assignment

2010-11-19 Thread david.sagan at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46339

--- Comment #23 from david.sagan at gmail dot com 2010-11-19 21:24:01 UTC ---
(In reply to comment #22)
> > > Is there something invalid here?
> >
> > Yes.  You need to allocate ptr unless you have
> > pault's [re-]allocate on assignment patch.
> 
> Even with Paul's patch it does not work.

It works for me. The following two variants give the correct result (and this
is without any patching):

program main
 use test
 implicit none
 type(a), target :: myA
 integer, dimension(:), pointer :: ptr
 myA%i(1:4)%j = (/ 1, 2, 3, 4 /)
 myA%i(1:4)%c = (/ 'a', 'b', 'c', 'd' /)
 allocate (ptr(4))
 ptr =  myA%i%j
 print *, "   ptr =", ptr
 print *, "   myA%i%j =", myA%i%j
end program main

program main
 use test
 implicit none
 type(a), target :: myA
 integer, dimension(:), pointer :: ptr
 myA%i(1:4)%j = (/ 1, 2, 3, 4 /)
 myA%i(1:4)%c = (/ 'a', 'b', 'c', 'd' /)
 ptr => myA%i%j
 print *, "   ptr =", ptr
 print *, "   myA%i%j =", myA%i%j
end program main


Both give:
ptr =   1   2   3   4
myA%i%j =   1   2   3   4


[Bug fortran/49328] New: Internal compiler error due to explicit array bounds in contained routine argument

2011-06-08 Thread david.sagan at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49328

   Summary: Internal compiler error due to explicit array bounds
in contained routine argument
   Product: gcc
   Version: 4.5.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: david.sa...@gmail.com


Consider the following program:

!---

module test_mod
contains
subroutine twiss3_at_start ()

implicit none

type t_struct
  real beta, alpha, gamma, phi
end type

type (t_struct) b
real g(6,6), tune3

call mode1_calc (g(3:4, 3:4), tune3, b)

contains

subroutine mode1_calc (gg, tune, twiss)

type (t_struct) twiss
real gg(2,2), tune

twiss%beta = gg(2,2)**2

end subroutine
end subroutine
end module


!---

compiling gives:

lnx4103:~/dcs/bmad_distribution/bmad_dist/test> gfortran --version
GNU Fortran (GCC) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc.

lnx4103:~/dcs/bmad_distribution/bmad_dist/test> gfortran -c -O2 test.f90
test.f90: In function 'twiss3_at_start':
test.f90:14:0: internal compiler error: in build2_stat, at tree.c:3681
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.


Removing the "-O2" compile option fixes things. Also changing "real gg(2,2)" to
"real gg(:,:)" also fixes things.


[Bug fortran/49597] New: gfortran namelist read bug

2011-06-30 Thread david.sagan at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49597

   Summary: gfortran namelist read bug
   Product: gcc
   Version: 4.5.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: david.sa...@gmail.com


Test program is:

program the_bug

implicit none

type example_struct
  logical logic
end type example_struct

integer readstatus
type(example_struct) fzz(3)
namelist /parameters/ fzz
!
open (unit= 10,file='the_bug.in')
read(10, nml = parameters,iostat=readstatus)
write(*,*) "iostat = ", readstatus
end program the_bug


Input file "the_bug.in" is:

¶meters 
fzz(1)%logic = .true.
fzz(2)%logic = .true.
/

bla bla bla


Running gives:

/lnx4103:~/dcs/bmad_distribution/test> gfortran --version
GNU Fortran (GCC) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

lnx4103:~/dcs/bmad_distribution/test> gfortran test.f90 ; ./a.out
 iostat = 5010


iostat should be 0. 
If you delete the "bla bla bla" line you get iostat = -1. 
If you change the name of the variable from "fzz" to, say, "zz" (2 places in
the program and 2 places in the_bug.in) you get iostat as 0 as it should be.
I have not tried extensively to test this but variable names beginning with "t"
and variable names beginning with "f" show the bug and other names do not.


[Bug fortran/49597] gfortran namelist read bug

2011-07-27 Thread david.sagan at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49597

--- Comment #4 from david.sagan at gmail dot com 2011-07-27 13:43:18 UTC ---
Yes a later version does not show the bug. Much thanks.

-- David


(In reply to comment #3)
> (In reply to comment #2)
> > I will tke this one.
> 
> Jerry: Judging from comment 1, it is already fixed for 4.4, 4.5 and 4.6/4.7.
> Thus, I think no action is required.
> 
> David: Thanks for the bugreport. Can you try a newer version of gfortran? Your
> Linux distribution might offer a new release (4.5.2 seems to be sufficient) -
> alternatively, you could try the ones at
> http://gcc.gnu.org/wiki/GFortranBinaries


[Bug fortran/101871] New: Array of strings of different length passed as an argument produces invalid result.

2021-08-11 Thread david.sagan at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101871

Bug ID: 101871
   Summary: Array of strings of different length passed as an
argument produces invalid result.
   Product: gcc
   Version: og10 (devel/omp/gcc-10)
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: david.sagan at gmail dot com
  Target Milestone: ---

Consider the test program:

program tao_program

implicit none
integer i
character(80) abc(9)
character(40) name

name = 'abasdfadsf'

abc = [character(80):: &
'Beam parameters not computed at: ' // trim(name), &
'Singular sigma matrix is:', &
'  \6es15.7\', '  \6es15.7\', '  \6es15.7\', '  \6es15.7\', ' 
\6es15.7\', '  \6es15.7\', &
'Will not print any more singular sigma matrices']

do i = 1, size(abc)
  print '(i6, 2x, a)', i, trim(abc(i))
enddo

call out_io_lines2 ([character(80):: &
'Beam parameters not computed at: ' // trim(name), &
'Singular sigma matrix is:', &
'  \6es15.7\', '  \6es15.7\', '  \6es15.7\', '  \6es15.7\', ' 
\6es15.7\', '  \6es15.7\', &
'Will not print any more singular sigma matrices'])

contains

subroutine out_io_lines2 (lines)

implicit none
character(*) lines(:)
integer i

do i = 1, size(lines)
  print '(i6, 2x, a)', i, trim(lines(i))
enddo

end subroutine out_io_lines2
end program



Now compile and run:
> gfortran tao_program.f90 
mac-mini-2:~/Bmad/test> ./a.out 
 1  Beam parameters not computed at: abasdfadsf
 2  Singular sigma matrix is:
 3\6es15.7\
 4\6es15.7\
 5\6es15.7\
 6\6es15.7\
 7\6es15.7\
 8\6es15.7\
 9  Will not print any more singular sigma matrices
 1  Beam parameters not computed at: abasdfadsf
 2  Singular sigma matrix is:
 3\6es15.7\
 4\6es15.7\
 5\6es15.7\
 6\6es15.7\
 7\6es15.7\
 8\6es15.7\
 9  Will not print any more singular sigma matr

Notice that the second "9" line is truncated. This should not be.