This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/35846] ICE on nested character constructors
- From: "domob at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Sep 2008 11:52:53 -0000
- Subject: [Bug fortran/35846] ICE on nested character constructors
- References: <bug-35846-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from domob at gcc dot gnu dot org 2008-09-20 11:52 -------
After coming back to this bug, I believe the problem is that gfc_conv_expr
takes care of finding out string lengths' for things like TRIM(x) which don't
have a cl->length, but gfc_conv_expr_descriptor which is called e.g. for the
array constructors does not do so and calls gfc_conv_string_length with a cl
whose length is NULL.
As the problem seems to be specific to array constructors and all array
constructor elements must have the same character length, I propose to re-use
gfc_conv_expr in gfc_conv_string_length to find out the string length if it is
NULL by taking the first element of each array constructor and then calling
gfc_conv_expr to get the result's string_length.
I'll submit a patch shortly if no further problems occur.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35846