------- Comment #2 from tobi at gcc dot gnu dot org  2007-10-10 12:59 -------
I have a patch for this.  Unfortunately, while playing around with testcases I
found a new segfault, so I'll have to look into this before submitting.

Failing testcase:
! { dg-do run }
! { dg-options "-fbounds-check" }
! { dg-shouldfail "Different CHARACTER lengths" }
! PR fortran/33254: No bounds checking for array constructors
program array_char
implicit none
character (len=2) :: x, y
character (len=2) :: z(2)
x = "a "
y = "cd"
z = [y(1:len(trim(y))), x(1:1)]  ! causes segfault
z = [trim(x),trim(y)] ! [ "a", "cd" ] ->INVALID: different string lengths
end program array_char

! { dg-output "Different CHARACTER lengths .2/1. in array constructor" }
! { dg-output "Different CHARACTER lengths .1/2. in array constructor" }


-- 

tobi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tobi at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-08-31 08:16:55         |2007-10-10 12:59:49
               date|                            |


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

Reply via email to