Bug 16236 - ICE with function returning string of variable length
Summary: ICE with function returning string of variable length
Status: RESOLVED DUPLICATE of bug 15326
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2004-06-27 20:12 UTC by Harald Anlauf
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Anlauf 2004-06-27 20:12:10 UTC
File: gfortran-bug3.f90

module trivial
contains
  function my_copy(str) result(s)
  implicit none
  character(*), intent(in):: str
  character(len(str)) s
  s = str
  return
  end function my_copy
end module trivial

program boom
  use trivial
  implicit none
  print *, my_copy('Boom!')
end program boom

Result:

% gfortran gfortran-bug3.f90 
f951: ../../gcc/gcc/fortran/trans-expr.c:1042: gfc_conv_function_call: Assertion
`sym->ts.cl && sym->ts.cl->length && sym->ts.cl->length->expr_type ==
EXPR_CONSTANT' failed.
gfortran-bug3.f90: In function `MAIN__':
gfortran-bug3.f90:15: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Andrew Pinski 2004-06-27 20:20:34 UTC
I think this is a dup of bug 15326.
Comment 2 Andrew Pinski 2004-06-27 20:29:29 UTC
Yes this is a dup of bug 15326.

*** This bug has been marked as a duplicate of 15326 ***