[Bug fortran/49885] [4.6/4.7 Regression] Segmentation fault when writing to an automatic character array

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jul 28 12:59:00 GMT 2011


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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|libfortran                  |fortran

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-07-28 12:58:54 UTC ---
Moved to "fortran", it's not a libgfortran issue but definitely a compiler-code
gen issue. Variant:

  print *, len(bad_rec)     ! << print correctly: 80
  bad_rec(1)(1:2) = 'abc'   ! << "works", but ...
  print *, bad_rec(1)(1:2)  ! << prints garbage

If the character(len=) expression is replaced by just the passed string length
("len=nb") it works.



More information about the Gcc-bugs mailing list